I am trying to make image viewer, which has overlay window with div in the center and inside the div an image that scales up and down on window resize that keeps its default ratio by using object-fit: contain; which is working ok. The problem is that when using object-fit: contain; it scales the content of the and the has