Photon and neutral pion distributions in 60 and 200 A GeV16O+nucleus and proton+nucleus reactions