PreImages( map, img )
In the first form PreImages returns the set of elements from the source
of the mapping map that are mapped by map to the element img in the
range  of map,  i.e.,  the set of elements  elm such  that  img in
Images(  map, elm  ) (see Images).  map may  be  a  multi valued
mapping.
    gap> g := Group( (1,2,3,4), (2,4), (5,6,7) );;  g.name := "g";;
    gap> p4 := MappingByFunction( g, g, x -> x^4 );
    MappingByFunction( g, g, function ( x )
        return x ^ 4;
    end )
    gap> PreImages( p4, (5,6,7) );
    [ (5,6,7), (2,4)(5,6,7), (1,2)(3,4)(5,6,7), (1,2,3,4)(5,6,7), 
      (1,3)(5,6,7), (1,3)(2,4)(5,6,7), (1,4,3,2)(5,6,7), 
      (1,4)(2,3)(5,6,7) ]
    gap> p5 := MappingByFunction( g, g, x -> x^5 );
    MappingByFunction( g, g, function ( x )
        return x ^ 5;
    end )
    gap> PreImages( p5, (2,4)(5,6,7) );
    [ (2,4)(5,7,6) ] 
PreImages( map, imgs )
In the  second form PreImages returns  the set of all  preimages of the
elements in the set of elements imgs, i.e., the  union of the preimages
of the single elements of imgs.  map may be a multi valued mapping.
    gap> PreImages( p4, [ (), (5,6,7) ] );
    [ (), (5,6,7), (2,4), (2,4)(5,6,7), (1,2)(3,4), (1,2)(3,4)(5,6,7), 
      (1,2,3,4), (1,2,3,4)(5,6,7), (1,3), (1,3)(5,6,7), (1,3)(2,4), 
      (1,3)(2,4)(5,6,7), (1,4,3,2), (1,4,3,2)(5,6,7), (1,4)(2,3), 
      (1,4)(2,3)(5,6,7) ]
    gap> PreImages( p5, [ (), (5,6,7) ] );
    [ (), (5,7,6) ] 
PreImages first checks in which form it is called.
In the first  case it calls  map.operations.PreImagesElm( map, img
) and returns this value.
The default function called this  way is MappingOps.PreImagesElm, which
runs  through all elements of  the source of map, if it is  finite, and
returns the set of those that have img in  their images.   Look  in the
index under  PreImages  to see  for  which  mappings  this  function is
overlaid.
In the second case if calls map.operations.PreImagesSet( map, imgs
) and returns this value.
The default function called this way is MappingOps.PreImagesSet,  which
returns the union of the preimages of all the elements of the set imgs.
Look in  the index  under PreImages  to  see  for which  mappings  this
function is overlaid.
GAP 3.4.4