'Compute the image of `self`.'

def image(self):

    if (self._image is None):
        values = list(set(self.images.values()))
        if isinstance(self.codomain, PermutationGroup):
            self._image = self.codomain.subgroup(values)
        else:
            self._image = FpSubgroup(self.codomain, values)
    return self._image
