code: func (i *ImageService) LogImageEventWithAttributes(imageID, refName, action string, attributes map[string]string) {
  	img, err := i.GetImage(imageID)
  	if err == nil && img.Config != nil {
  		// image has not been removed yet.
  		// it could be missing if the event is `delete`.
  		copyAttributes(attributes, img.Config.Labels)
  	}
  	if refName != "" {
  		attributes["name"] = refName
  	}
  	actor := events.Actor{
  		ID:         imageID,
  		Attributes: attributes,
  	}
  
  	i.eventsService.Log(action, events.ImageEventType, actor)
  }
docs: // LogImageEventWithAttributes generates an event related to an image with specific given attributes.