fix for a bug in haveSameAspectRatio function