How to get the image index from the image name?

In math processor variables are related to image index (iM#123}. Names are not accepted.
How to get the index from a named image?

By breaking the double quotes and using $image_name, which will be substituted in the argument of, e.g., fill before execution:

foo : 
  sp lena,eagle
  f. "i(#"$lena",x,y) = i"  

Ja, super, I never thought to use image names as variables

repeat {iM#$label}

with an image named label works. Thank you!

You don’t even need the braces anymore:

repeat iM#$label

is OK too.

Interesting. What if there was a variable with the same name as the image? Would the next assignment replace the original?