improve slideshow with window resize