Image formats decide how big your files are and how good they look. For a gallery site, that’s most of the battle.
JPEG has been around since the early 1990s. It’s lossy, meaning it throws away detail the eye is unlikely to miss to get a smaller file. Every browser and every device opens it. It’s the safe default.
The newer options
WebP came out of Google and usually beats JPEG on file size at similar quality. It also handles transparency, which JPEG can’t. AVIF is newer still, based on the AV1 video codec, and often gets files smaller again. The catch is that it can be slow to encode, and older software may not open it.
PNG is lossless. Nothing is thrown away, so it’s the right choice for screenshots, logos and graphics with hard edges. For photographs, PNG files get huge.
A practical setup
Keep your original at the highest quality you have. Serve WebP or AVIF to browsers that support them and fall back to JPEG for the rest. Test with real photos, because a format that looks great on a landscape can smear fine textures like hair or fabric.
Smaller files mean faster pages, and faster pages get looked at.