Electron energy loss spectroscopy as a probe of two-dimensional photonic crystals