Fix bits per image channel calculation.