Uploading a .jpg image fails with an invalid MIME type message.
Why this happens
MIME types follow strict standard syntax; .jpg is an extension rather than a valid image subtype. The uploaded payload must match the supplied MIME string.
Answer 1: Use the canonical MIME type
mime_type = "image/jpeg" # not "image/jpg"
Provide standard identifiers such as image/png or image/webp for other media types.
