I might call this function `get_content_type_by_extension`, and call it `content_type` across.  The type is something specific to our app.

Even `content_type` has a special meaning (in HTTP-land), so perhaps `kind` is best.  Right--looking at this, you're getting `kind`, so let's call this `get_kind_by_extension`, and rename the variable to `kind`