I've had some issues with this as well. I have found a way that works for any images which do not include some of the latter colors (because they have duplicate color values). I have been using Gimp for this; what I have been doing is as follows:
Preliminary steps:
1) For images without transparency, just edit them as normal (duh);
2) Open an image for editing; I prefer using PNGs. It can be any image as long as it has transparency.
3) Immediatelly go to File -> Save As and click Save, then Replace.
4) In the following dialog, check "Save background color", "Save layer offset", "Save resolution" and "Save creation time", and uncheck everything else. Click "Save defaults" and OK.
5) Get this (
http://www.geocities.com/mg_rpg_online/Ultima7-256.zip) palete and import it in Gimp; for importing, go to Dialogs -> Palettes, click the left-pointing arrow, choose Palettes Menu -> Import Palette.
OK, now you are ready to edit U7 images. Here is what you will have to do to get it to work correctly:
1) When you open an image with transparency, go to Image -> Mode -> RGB.
2) Immediatelly afterwards, go to Image -> Mode -> Indexed and select the palette above. Be sure to UNCHECK "Remove unused colors from final palette"!
The bad part is that I have been unable to get the images working right without having to perform these last two steps. And as I mentioned, some of the last colors are duplicates of previous colors; this distinction will be lost by this procedure...
I hope this helps.