I need to adjust various images of unknown sizes (some bigger, some smaller) to fit inside a container of a known size while maintaining their aspect ratio. The goal is to stretch and center the images within the container.
To clarify:
If the images are larger, they should be resized to fit within the container while maintaining their aspect ratio and centered.
If the images are smaller, they should remain the same size and be centered within the container.
Any suggestions on how to achieve this?