Critical thickness for the agglomeration of thin metal films