As I already stated you either ran the 311 upgrade twice or you never needed to in the first place which is what I had already posted. Whatever your doing your running that script and putting the userid on the front of the images again
If you insist your not running it twice then you already had 3.2 and not 3.1 and mistakenly ran that upgrade again.
So restore your photos table and using phpmyadmin see what your photo names are in your products table bigimage field. If they have a number in front of the image name DO NOT RUN 3.1 upgrade run 3.2 forward.
Your issue can only be what I am saying.