So, 40 might be the color green. But from another picture you load (image b) you have the color blue at place 40. If you use both of these bitmaps, and the palette of one picture. You will see the other picture with the palette of the former picture.
Hope that explains it.
------------------
Dance with me......