There was a similar report prior to the introduction of the Image
Engine, see T74586.
This was fixed by rB6a5bd812b569 at that time, but got lost in the
refactor it seems.
Above commit introduced the ED_space_image_get_display_channel_mask
function that will determine
the valid bitflags for the display channel of a given ImBuf.
But since the refactor, this is not called anymore (draw_image_main is
not called anymore)
Now it seems we can safely reuse that said function
ED_space_image_get_display_channel_mask also for the Image Engine.