I have had this issue before, and I noticed that I have it less often when I use the link tool button instead of just copying and pasteing the link into the reply. The other think I do (and I don't know if it makes a difference) is that when I first upload my photo to the gallery, I then go to the home page, and click on my photo again in case the URL is different for the page when you do it that way.
However, that does not fix it all of the time.
I am not techy enough to really figure it out, but I wondered if when a user is logged into the site, if they URL they get in the gallery might have a marker that is different?