The problem is that there's two aspect ratios to take into account.
You have the aspect ratio of the screen with you're calculating in the aspectRatioHeight method, but there's also the aspect ratio of the image.
Consider a image that is 100x100 pixels, and you want to place that with a 10px margin on a screen that is 640x480.
If you set the width of the sprite to 640-10-10=620px, what should the height be?
What you're trying to do is to scale the sprite's height by the aspect ratio of the screen, which is this case is 480/640=0.75, but as the image is 100x100 and therefore has an apsect ratio of 1 that will skew it.
If you have a source image with an aspect ratio different that the target viewport you will have to accept one of these compromises;
- Skew the image (but you don't want that)
- Letter box the image, i.e pad the top/bottom or left/right with something (this happens when watching wide screen movies on a 4/3 TV, sometimes).
- Stretch the image, by stretching you don't get the padding of letter boxing, but you'll miss some of the image as it stretches beyond the visible viewport.