guess the thumbnail by extension first then mimetype