Gandalf is standing on top of an outcropping of rock. Either that, or the snow compacted after the avalanche. If that was the case, it would explain why EVERYONE was able to stand on top of the snow. Of, der... Standing on snow is the easy part, it is the walking that gets ya.
Since he is human (even a super powerul wizard) he is too heavy to walk on snow.
Legolas, OTOH, being an elf, is light enough to tread on snow. A difference between book and movie-- In book, he runs over the snow. In movie, he walks. Anyways, Gandalf couldn't walk on the snow, thus, he DIDN'T walk on the snow.