Is the imageSize parameter the size of the image data with or without the palette?
I.E. I have a 512KB palette and 128*128 bytes of pixels for a total of 16896 bytes. Should I be passing that or just 128*128?
I'm pretty sure it's with palette, but better to be safe than sorry.