Implemented next, previous, and slideshow function