Improve thumbnail generation. Fixes.