Thumbnail create function.