fixed most problems with the 32 to 24 bit confertion.

Next is to build/upgrade the algoritme to place the picture are the correct place.