code: public static Image findImageByIdOrByTag( String name, DockerClient dockerClient ) {
  
  		Image image = null;
  		if( ! Utils.isEmptyOrWhitespaces( name )) {
  			Logger logger = Logger.getLogger( DockerUtils.class.getName());
  
  			List<Image> images = dockerClient.listImagesCmd().exec();
  			if(( image = DockerUtils.findImageById( name, images )) != null )
  				logger.fine( "Found a Docker image with ID " + name );
  			else if(( image = DockerUtils.findImageByTag( name, images )) != null )
  				logger.fine( "Found a Docker image with tag " + name );
  		}
  
  		return image;
  	}
docs: Finds an image by ID or by tag.
  @param name an image ID or a tag name (can be null)
  @param dockerClient a Docker client (not null)
  @return an image, or null if none matched