Made lead_image rendering more robust