next and previous buttons work for both thumbnails and normal viewing