I finally got it all going, but it's been a slow weekend.
Now Imager can read images from a GIF file as separate images, with the palette for each image, since Imager now has indexed images. The new read_multi() function sets tags on each image, including transparency and animation information.
Now I just need to find the tuits to make the writegif_gen() code understand paletted images.