Update image processor parameters if creating with kwargs
Author: amyeroberts
Pull request: yes

# What does this PR do?

Ensures backwards compatibility with previous feature extractor creation when using `from_pretrained` and `from_dict`.

**Updates attribute before instantiation:** 
Previously, `size` attributes were stored as an int/tuple. This has been updated to a dictionary to reduce ambiguity of whether the int represents the shortest edge, height or width. If the feature extractor / image processor is created with `size` as an int, it is converted to the appropriate dictionary with a `logging.info` message. However, if the image processor is created using `from_pretrained` or `from_dict` with `size` as a kwarg, the class is first instantiated and then the `size` kwarg overwrites the class parameter. In this case, `image_processor.size` is an int, and is not be converted to the correct dictionary format. This PR makes sure the dict creating the instance has the updated value, which is then converted to a dict if necessary. 

**Renames attribute before instantiation**
Some feature extractor instance attributes have been removed when updating to image processors. For example `reduce_labels` became `do_reduce_labels` to ensure naming consistency and `max_size` is now part of the `size` dictionary as `size["longest_edge"]`. In `from_dict`, if the instance doesn't have the attribute, and the attribute is passed in as a kwarg with its old name, the instance won't have it added as an attribute. This PR will update the name of the attribute in `from_dict` to the new name if necessary.

Previously:
```python
>>> image_processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50", size=600, max_size=800)
>>> image_processor
DetrImageProcessor {
  "do_normalize": true,
  "do_pad": true,
  "do_rescale": true,
  "do_resize": true,
  "feature_extractor_type": "DetrFeatureExtractor",
  "format": "coco_detection",
  "image_mean": [
    0.485,
    0.456,
    0.406
  ],
  "image_processor_type": "DetrImageProcessor",
  "image_std": [
    0.229,
    0.224,
    0.225
  ],
  "resample": 2,
  "rescale_factor": 0.00392156862745098,
  "size": 600
}
```  

Now:
```python
>>> image_processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50", size=600, max_size=800)
>>> image_processor
DetrImageProcessor {
  "do_normalize": true,
  "do_pad": true,
  "do_rescale": true,
  "do_resize": true,
  "feature_extractor_type": "DetrFeatureExtractor",
  "format": "coco_detection",
  "image_mean": [
    0.485,
    0.456,
    0.406
  ],
  "image_processor_type": "DetrImageProcessor",
  "image_std": [
    0.229,
    0.224,
    0.225
  ],
  "resample": 2,
  "rescale_factor": 0.00392156862745098,
  "size": {
    "longest_edge": 800,
    "shortest_edge": 600
  }
}
```

## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [x] Did you write any new necessary tests?


Comments:
_The documentation is not available anymore as the PR was closed or merged._