def METHOD_NAME(
    image_url: str,
    media_identifier: str,
    accept_header: str = "image/*",
    is_full_size: bool = False,
    is_compressed: bool = True,
) -> HttpResponse:
    """
    Proxy an image through Photon if its file type is supported, else return the
    original image if the file type is SVG. Otherwise, raise an exception.
    """
    logger = parent_logger.getChild("get")
    tallies = django_redis.get_redis_connection("tallies")
    month = get_monthly_timestamp()
    image_extension = get_image_extension(image_url, media_identifier)
    headers = {"Accept": accept_header} | HEADERS
    parsed_image_url = urlparse(image_url)
    domain = parsed_image_url.netloc
    upstream_url, params, headers = get_request_params_for_extension(
        image_extension,
        headers,
        image_url,
        parsed_image_url,
        is_full_size,
        is_compressed,
    )
    try:
        upstream_response = requests.METHOD_NAME(
            upstream_url,
            timeout=15,
            params=params,
            headers=headers,
        )
        tallies.incr(f"thumbnail_response_code:{month}:{upstream_response.status_code}")
        tallies.incr(
            f"thumbnail_response_code_by_domain:{domain}:"
            f"{month}:{upstream_response.status_code}"
        )
        upstream_response.raise_for_status()
    except Exception as exc:
        exception_name = f"{exc.__class__.__module__}.{exc.__class__.__name__}"
        key = f"thumbnail_error:{exception_name}:{domain}:{month}"
        count = tallies.incr(key)
        if count <= settings.THUMBNAIL_ERROR_INITIAL_ALERT_THRESHOLD or (
            count % settings.THUMBNAIL_ERROR_REPEATED_ALERT_FREQUENCY == 0
        ):
            with push_scope() as scope:
                set_context(
                    "upstream_url",
                    {
                        "url": upstream_url,
                        "params": params,
                        "headers": headers,
                    },
                )
                scope.set_tag(
                    "occurrences", settings.THUMBNAIL_ERROR_REPEATED_ALERT_FREQUENCY
                )
                sentry_sdk.capture_exception(exc)
        if isinstance(exc, requests.exceptions.HTTPError):
            tallies.incr(
                f"thumbnail_http_error:{domain}:{month}:{exc.response.status_code}:{exc.response.text}"
            )
        raise UpstreamThumbnailException(f"Failed to render thumbnail. {exc}")
    res_status = upstream_response.status_code
    content_type = upstream_response.headers.METHOD_NAME("Content-Type")
    logger.debug(
        f"Image proxy response status: {res_status}, content-type: {content_type}"
    )
    return HttpResponse(
        upstream_response.content,
        status=res_status,
        content_type=content_type,
    )