'Retrieves image and for v2 api and creates adapter like object
to access image core or custom properties on request.'

def _get_v2_image_metadata(self, request, image_id):

    db_api = glance.db.get_api()
    image_repo = glance.db.ImageRepo(request.context, db_api)
    try:
        image = image_repo.get(image_id)
        request.environ['api.cache.image'] = image
        return policy.ImageTarget(image)
    except exception.NotFound as e:
        raise webob.exc.HTTPNotFound(explanation=e.msg, request=request)
