Improved thumbnails generation