After updating to 3.5, the links to my images all give an error. If I load them in a thickbox, I get a 404. If I load them in the browser window, I am redirected to the post in which the image was included.
I've tried to resave the permalink structure a couple of times. I also tried to edit the attachment.php file in my theme folder, still no result.
The permalink structure is /%postname%/%filename%
When I open an attachment, I get redirected to /%postname%/