next,prev,clicking on large image, and clicking on thumbnails all work.some refactoring