fix a crash when resizing with a dimension to 0 (based on the ImageView dimensions)
reuse the same paint object for the resizing