Made handling of broken images when printing more robust