It could be, but it could also be terrifyingly slow and unoptimized.
If you're interested in something like that, I recommend you to create a function to sort it out.
It would be something like this:
function graph_me(int file,string name);
from x=1 to 999;
But.... there's no function to retrieve the name of the graphic from the FPG, so that way won't directly work (I think)