Dear @comedowntous
you can simplify the code much more:
Create a folder on AWS or somewhere and name the images 1.jpg, 2.jpg, 3…
Make a HTML box and call it images-box or whatever
Write a JS which counts from 1 until X. Lets say 10 when you have 10 images.
Then use the Javascript to change the CSS code for the background image of the image-box.
"www.aws.com/my-images/" + imagenumer + "jpg"
Hope that helped a bit.
But there must be simple scripts for that online.
it should be really much simpler.
Best!
Marius