Your config seems quite different than what I see in the article. Why are you using autohandler.mason, dhandler.mason, instead of autohandler and dhandler? It's as if you named your Perl scripts foo.Perl instead of foo.pl.
I think you're missing the first part of the configuration in your article:
Without that, how would Apache know that Mason is in charge of things under /gallery?