404 error on some image access after copying site (7 posts)

I thought I successfully copied my site from a remote server to my PC by using all the advice I could find on the WordPress sites by changing URL information in my local MySQL database and in WordPress.

Most everything works but I have a persistent 404 error when trying to access some detailed blog information that deals with attachments.

Let me try to describe the access procedure when it works:
(I tested that creating a new post with image)
localhost:12345/indexphp/blogs/
and on the remote serverhttp://www.site.com/wordpress/blogs/
shows my main blog page.

And when I select one of these imags on localhost I get a screen localhost:12345/index.php/2012/12//25/pagename/dsc01234/
with that image and the image is identified as
localhost:12345/wp-content/uploads/2012/12/DSC1005.jpg

But here is what happens when I try to do the same procedure with a post downloaded from the remote server to localhost:

localhost:12345/indexphp/2012/12/22/pagename/
shows the blog with the text and images.

However, when I now select one of the images I get the following error message:
HTTP error 404.0
Requested URL localhost:12345/2012/12/22/postname/dsc01222/
Physical Path D:\Sitename\2012\12\22\postname\dsc01222\

Of course, the proper physical path would be:
D:\Sitename\wp-content\uploads\2012\12\22\postname\dsc01222.jpg

Thus when I type in the proper URL by adding index.php:
localhost:12345//index.php/2012/12/22/postname/dsc01222/
I get the proper screen w/o an error.

So why is the index.php reference missing from the requested URL?

It seems to me that my local database still has some flaws. So I compared the original database entries (wp-posts) on the remote server with the same entries on my localhost. Here is the comparison.

post_content on the remote server where the attachment is shown properly:

The problem definitely has to do with permalink settings because some stuff I can get to work with one setting and other stuff with another on localhost. Only on the remote server everything works.

The problem I am trying to resolve:

On localhost the image has a href=http://localhost/2012/12/21/page_name/dsc123456 this is NOT working, i.e this reference is not found.
However, the src=http://localhost/wp-content/uploads/.... is working

On the remote server
href=http://site.com/wordpress/2012/12/21/page_name/dsc123456/ this is working.

Obviously replacing "site.com/wordpress" with localhost in the database does not do the trick as all the href references containing ../page_name/... are invalid on localhost. The physical path does not exist.