ngx_pagespeed would be another way of serving WebP to supporting browsers and JPEG to others.
By the way, it's remarkable when running an image-heavy site how much bot/mass downloader traffic relative to humans vanish when turning away Firefox user agents.