Search for Higgs and Z Boson Decays to J/ψγ and (nS)γ with the ATLAS Detector