fixes to non truecolor images. Also convert indexed images to truecolor before display