Fix indexed support

Fix indexed support, and use QImage::Format_Indexed8 in grayscale mode to save memory.
And I found a nice reference: https://github.com/OpenImageIO/oiio/blob/master/src/psd.imageio/psdinput.cpp