added support for < 8 bits per pixel indexed png