Fix attempting to resize the canvas to invalid dimensions