Same problem here ...
I wanted a static site to be generated from a directory with a whole lot of photos... [ just files .. no back end web server / php or database ]
I ended up writing a script to wrangle the image files, and piGallery2 to show them. The script finds the images, makes thumbs, renames/resizes/converts and theres a single html with javascript that reads the list, and uses piGallery2 to show the photos.
ps. I wanted to use avif file formats, as the files are smaller than jpg files, by a lot.
Sample here, with a few pics from pexels : http://quato.xyz/pix/pexels_italy/
[ it is a static site, so no server code .. although the web front end does use javascript .. I just copied the bundle of files under my current web server directory ]