Cache thumbnails size and add width and height attributes.