You can not link an image using the script value
http://www.domain.com/showphoto.php?photo=789
It has to be with the image tag and the true image path like this
http://www.domain.com/data/501/somepic.jpg
Now if you move that picture to say cat 503 that url would change which is what I posted.