another approach to fix #5836 (#5841)

* Revert "properly detect grayscale JXL images (https://github.com/ImageMagick/ImageMagick/issues/5836)"

This reverts commit c327e0008b5139a0c9245d8f226405afa70ea23a.

* add missing break

* another approach to properly detect grayscale JXL images (https://github.com/ImageMagick/ImageMagick/issues/5836)