Fixing palette interlaced images and palette pictures with width % 8 != 0

This hopefully just works like a charm. It could potentially be faster because all of these bounds checks but I supposed that they get dwarfed by the index calculations…