def normalize_docker_registry_name(image_name):
    """Normalize the name of an image for Docker registry"""
    if image_name.startswith('_/'):
        # On Docker Hub, "_/name" means "library/name"
        return 'library/{}'.format(image_name[2:])

    if '/' not in image_name:
        # Official images are located in library
        return 'library/{}'.format(image_name)

    return image_name