Refactors slideshow js object