Re-encode newly uploaded avatars before they are stored, so that the
original upload is never stored or served. The stored image fits within
512x512 pixels, is rotated upright, converted to sRGB, has only the
first frame of any animation, and has all metadata (such as EXIF GPS
location) stripped. Non-web formats are stored as PNG, and the filename
is replaced, since it's visible in avatar URLs.
This is done synchronously, since processing a large photo takes well
under 100ms, and doing it in the background would mean the original
reaching storage (and any backups of it) first.