Fixed JS code for the slideshows. Used to have problem with pressing previous and going negative.