Fixed a bug when leaving image directory to the left
(displaying first image and clicking previous button)
and resulting errors when going farther and farther to the left