This class can generate thumbnail images to fit according to div width and height.