improvements for thumbnail generator.