Numerical simulations of localization of electromagnetic waves in two- and three-dimensional disordered media