Fix DeprecationWarning: Using mimetype keyword argument is deprecated, use content_type instead