<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def iiif_image_handler(prefix=None, identifier=None, path=None, config=None, klass=None, auth=None, **args):
 """Handler for IIIF Image Requests. Behaviour for case of a non-authn or non-authz case is to return 403. """

    if (not auth or degraded_request(identifier) or auth.image_authz()):
        # serve image
        if (auth):
            logging.debug("Authorized for image %s" % identifier)
        i = IIIFHandler(prefix, identifier, config, klass, auth)
        try:
            return i.image_request_response(path)
        except IIIFError as e:
            return i.error_response(e)
    else:
        # redirect to degraded (for not authz and for authn but not authz too)
        degraded_uri = host_port_prefix(
            config.host, config.port, prefix) + '/' + identifier + '-deg/' + path
        logging.info("Redirection to degraded: %s" % degraded_uri)
        response = redirect(degraded_uri)
        response.headers['Access-control-allow-origin'] = '*'
        return response