Thumbnails

Vast improvements to image gallery and file variant/thumbnail handling.