public String getNameWithOptionalRepository(String optionalRepository) {
        if (optionalRepository != null) {
            String simpleName = getFullName();
            String[] simpleNameParts = simpleName.split("/");
            if (simpleNameParts.length > 0) {
                return optionalRepository + "/" + simpleNameParts[simpleNameParts.length - 1];
            }
        }
        return getFullName();
    }
Get the simple name of the image, which is the repository sans the user parts.

@return simple name of the image
src/main/java/io/fabric8/maven/docker/util/ImageName.java