PDF with images did not work without fopen (#999)