'Tells registry about an image\'s metadata'

def add_image(self, image_metadata):

    headers = {'Content-Type': 'application/json'}
    if ('image' not in image_metadata):
        image_metadata = dict(image=image_metadata)
    encrypted_metadata = self.encrypt_metadata(image_metadata['image'])
    image_metadata['image'] = encrypted_metadata
    body = jsonutils.dump_as_bytes(image_metadata)
    res = self.do_request('POST', '/images', body=body, headers=headers)
    data = jsonutils.loads(res.read())
    image = data['image']
    return self.decrypt_metadata(image)
