conditional for height or width scaling