fix bad behavior if pngcairo is input as device