Tidied up next button js in image gallery.