more work on thumbnail generation