I made something for Mastodon: A gallery mini-app.
https://source.joinmastodon.org/Gargron/gallery
You can simply drop it in your Mastodon server's public folder, and it will show images from your server in a mosaic grid with infinite scroll. Supports some configuration as well, e.g. whether to limit it to only local images, or a specific hashtag, or which server to fetch from.