Fix MaskformerFeatureExtractor
# What does this PR do?

This PR fixes MaskFormer's feature extractor. 

PR #18997 introduced a bug which made the feature extractor create the same binary mask for all segments/instances in an image, hence making it impossible to fine-tune the model. This PR fixes it and makes sure the model can be properly fine-tuned on instance, semantic and panoptic segmentation datasets.

To do:

- [x] add tests
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_20100). All of your documentation changes will be reflected on that endpoint.<|||||>The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_20100). All of your documentation changes will be reflected on that endpoint.<|||||>@sgugger could you approve this PR, so that I can merge this critical fix to MaskFormerFeatureExtractor?

I'll open a separate PR for improving the docs around image segmentation.