Reproducing spatial fluctuations of electromagnetic showers