This pixel math expression,
IMG = foo;
Avg(IMG)
yields this error,
Avg() takes either a single image reference argument or a set of two or more arguments:
IMG = foo; Avg( |IMG )
It works fine if you don't use a variable, like this,
Avg(foo)
Note in the error message that a pipe is shown in the argument of Avg. Seems like a clue.
Thanks,
Mike