When dealing with images of different sizes, the combination of the CSS aspect-retio and object-fit: cover properties can be useful. Although it is a relatively new property, it is already available in almost all modern browsers, including mobile.
You can arrange images of different sizes together.
Already available in almost all modern browsers, including mobile