Refactor ThumbnailUtil