def is_image_available(context, image):
    """Check image availability.

    This check is needed in case Nova and Glance are deployed
    without authentication turned on.
    """
    if hasattr(context, 'auth_token') and context.auth_token:
        return True
    if getattr(image, 'visibility', None) == 'public' or context.is_admin:
        return True
    return context.project_id and getattr(image, 'owner', None
        ) == context.project_id
