bug fix: on window resize, next image wouldnt load