def guess_content_type(name):
    """Return the content type by the extension of the filename."""
    if name.endswith(".jpg"):
        return "image/jpg"
    elif name.endswith(".jpeg"):
        return "image/jpeg"
    elif name.endswith(".png"):
        return "image/png"
    elif name.endswith(".gif"):
        return "image/gif"
    elif name.endswith(".bmp"):
        return "image/bmp"
    return "image/jpg"