Searches for the rare Higgs and Z boson decays to Mγ with ATLAS at the Large Hadron Collider, with M = J/ψ, ψ(2S), Υ(1S), Υ(2S), Υ(3S)