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