hmmmm???
In my system (Mma 7) ArrayPlot has no Option Plotlegend (without s!)
What does the function nd do? Your piece of code does not work without a definition of nd!
It could be helpful if you described your problem more precisely and to define what you really want to do.