Search for heavy resonances decaying into a photon and a hadronically decaying Higgs boson in $pp$ collisions at $\sqrt{s}=13$ TeV with the ATLAS detector