Fixed the logic in ihl_grayscale_contained().