Calculate width properly if image is bounded by height only

Bug: 63185
Change-Id: Ie74dcba495cac7cfe53065d2cd3b559c14fc0ca4
Merge "Calculate width properly if image is bounded by height only"