adding slideshow functionality to gallery