This should happen only with older images imported from the old GWM site. Uploads were approved in batches, so many of the pics have the same timestamp. When this is the case, their ordering is arbitrary, and the "Next" button may report a different image than what you see in the image index.
I tried fixing it by also making it do a secondary-sort by ID (so if the timestamp is the same, sort by ID), but it turns out this decreased the performance quite a bit and as a result is unfortunately not worth it.
you click on a picture and you use the prev or next , the pictures do not sequence in the same order