Search for higgs and Z boson decays to J/ψγ and (nS)γ with the ATLAS detector