Improved handling of thumbnail images.