Adding slideshow js logic