RF-13629: Applied the same changes to the height handling as were applied to the width handling in RF-13616