Fix channel count when exporting RGB images

Fixes #12091, #11569.
Merge pull request #1179 from melissalinkert/rebased/dev_5_0/rgb-export

Fix channel count when exporting RGB images in ImageJ (rebased onto dev_5_0)