Next and Previous don't move to undefined images