Interactions of ultrahigh-energy cosmic rays with photons in the galactic center