jquery-object-fit
A small example
HTML Scaled
CSS Object Fitted
Jquery Object Fitted