slideshow logic modified