def normalize_tag_name(name_tag):
    """
    docker-py provides "RepoTags", which are strings of format "<image name>:<image tag>"

    We want to strip off the tag part and normalize the name:

       some.domain.com/organization/image:tag -> organization/image
                       organization/image:tag -> organization/image
                                    image:tag ->              image
    """
    return "/".join(name_tag.rsplit(":", 1)[0].split("/")[-2:])