Keep image aspect ratio if only 1 dimension styled

If only one of image width or height is specified, then scale missing
dimension to maintain the aspect ratio.