Greatly improve performance by processing per file and use image/jpeg compression for thumbnails
Add experimental functions for getting thumbnail data