Added methods to constrain just the width or height