fix a crash when resizing with a dimension to 0 (based on the ImageView dimensions)

If some width or height are not set it tries to get them from the ImageView, but in this case it's missing the ImageView reference.