snippet to fill an image to a container and retain it's aspect ratio