apply factory method pattern to ThumbnailManager class.