Fix resize when only width or height is defined