``` object-fit: cover ```
comes to mind as a client-side solution I used in the past for this problem