JS updates to optimize slideshow