include images in mail sent as pdf (closes #3730)

also remove some notices and cleanup code