handle zero width/height images in cairo backend.