Complex dynamics of photon entanglement in the two-mode Jaynes–Cummings model