Fixed #277 (zero-area scaled images cause errors)