'Set the system to use a certain named image.  Works like set_profile
but cannot be used at the same time.  It\'s one or the other.'

def set_image(self, image_name):

    old_parent = self.get_parent()
    if ((image_name in ['delete', 'None', '~', '']) or (image_name is None)):
        self.image = ''
        if isinstance(old_parent, item.Item):
            old_parent.children.pop(self.name, 'pass')
        return
    self.profile = ''
    img = self.collection_mgr.images().find(name=image_name)
    if (img is not None):
        self.image = image_name
        self.depth = (img.depth + 1)
        if isinstance(old_parent, item.Item):
            old_parent.children.pop(self.name, 'pass')
        new_parent = self.get_parent()
        if isinstance(new_parent, item.Item):
            new_parent.children[self.name] = self
        return
    raise CX((_('invalid    image    name    (%s)') % image_name))
