Fix slideshow logic