Pretreatment of the gases prior to electrostatic precipitation