The next previous depend on information sent to them in links. They are totally different throughout the program depending on the links presented.
I really cant say without seeing the links your getting to go to a photo but for example if your site link to the photo is simply showphoto.php?photo=12 then thats totally random next previous links. But for example if you hit a photo going through the members gallery it passes a userid variable and then that affects the next prev thumbs. See the point.