Preservation of electron microscope image contrast after inelastic scattering