refactored how slideshow image calculation works for homepage