Search for Higgs and Z Boson Decays to J/psi gamma and Upsilon(nS)gamma with the ATLAS Detector