Scavenging of SO2 and NH3 during growth of ice