code: func createImageIndex(images []v1Image, tags map[image.ID][]string) []*registry.ImgData {
  	var imageIndex []*registry.ImgData
  	for _, img := range images {
  		v1ID := img.V1ID()
  
  		if topImage, isTopImage := img.(*v1TopImage); isTopImage {
  			if tags, hasTags := tags[topImage.imageID]; hasTags {
  				// If an image has tags you must add an entry in the image index
  				// for each tag
  				for _, tag := range tags {
  					imageIndex = append(imageIndex, &registry.ImgData{
  						ID:  v1ID,
  						Tag: tag,
  					})
  				}
  				continue
  			}
  		}
  
  		// If the image does not have a tag it still needs to be sent to the
  		// registry with an empty tag so that it is associated with the repository
  		imageIndex = append(imageIndex, &registry.ImgData{
  			ID:  v1ID,
  			Tag: "",
  		})
  	}
  	return imageIndex
  }
docs: // createImageIndex returns an index of an image's layer IDs and tags.