code: def update(self, img, value_dict):
          
          img = self.get(img)
          uri = "/%s/%s" % (self.uri_base, utils.get_id(img))
          body = []
          for key, val in value_dict.items():
              op = "replace" if key in img.__dict__ else "add"
              body.append({"op": op,
                      "path": "/%s" % key,
                      "value": val})
          headers = {"Content-Type":
                  "application/openstack-images-v2.1-json-patch"}
          resp, resp_body = self.api.method_patch(uri, body=body, headers=headers)
docs: Accepts an image reference (object or ID) and  dictionary of key/value
          pairs, where the key is an attribute of the image, and the value is the
          desired new value for that image.
  
          NOTE: There is a bug in Glance where the 'add' operation returns a 409
          if the property already exists, which conflicts with the spec. So to
          get around this a fresh copy of the image must be retrieved, and the
          value of 'op' must be determined based on whether this attribute exists
          or not.