Variability in group size and the evolution of collective action