def METHOD_NAME(req):
    def _image_query(imagename, req):
        action = get_action()
        return action.query(req, imagename)
    imagename = None
    if 'imagename' in req.GET:
        imagename = req.GET['imagename']
    info = _image_query(imagename, req)
    info_json = json.dumps(info)
    req.response.body = utils.to_utf8(info_json)
    req.response.status = util.get_http_code_from_sdk_return(info,
        additional_handler = util.handle_not_found)
    req.response.content_type = 'application/json'
    return req.response