Study of Z\gamma events and limits on anomalous ZZ\gamma and Z\gamma\gamma couplings in ppbar collisions at sqrt(s) = 1.96 TeV