fix start index calculation for slideshow