added new aspect ratio calc method for images that need to fit inside a box