Use scaleimage instead of thumbnailimage.