code: func (c *Cluster) RemoveImage(name string) error {
  	stor := c.storage()
  	image, err := stor.RetrieveImage(name)
  	if err != nil {
  		return err
  	}
  	hosts := []string{}
  	idMap := map[string][]string{}
  	for _, entry := range image.History {
  		_, isOld := idMap[entry.Node]
  		idMap[entry.Node] = append(idMap[entry.Node], entry.ImageId)
  		if !isOld {
  			hosts = append(hosts, entry.Node)
  		}
  	}
  	_, err = c.runOnNodes(func(n node) (interface{}, error) {
  		imgIds, _ := idMap[n.addr]
  		err = n.RemoveImage(name)
  		_, isNetErr := err.(net.Error)
  		if err == docker.ErrConnectionRefused {
  			isNetErr = true
  		}
  		if err != nil && err != docker.ErrNoSuchImage && !isNetErr {
  			return nil, err
  		}
  		for _, imgId := range imgIds {
  			// Errors are ignored here because we're just ensuring any
  			// remaining data that wasn't removed when calling remove with the
  			// image name is removed now, no big deal if there're errors here.
  			n.RemoveImage(imgId)
  			stor.RemoveImage(name, imgId, n.addr)
  		}
  		return nil, nil
  	}, docker.ErrNoSuchImage, true, hosts...)
  	return err
  }
docs: // RemoveImage removes an image from the nodes where this images exists,
  // returning an error in case of failure. Will wait for the image to be
  // removed on all nodes.