def image_destroy(context, image_id):
    session = get_session()
    with session.begin():
        image_ref = image_get(context, image_id, session=session)

        # Perform authorization check
        check_mutate_authorization(context, image_ref)

        image_ref.delete(session=session)

        for prop_ref in image_ref.properties:
            image_property_delete(context, prop_ref, session=session)

        for memb_ref in image_ref.members:
            image_member_delete(context, memb_ref, session=session)
Destroy the image or raise if it does not exist.
dataset/ETHPy150Open rcbops/glance-buildpackage/glance/registry/db/api.py/image_destroy