If by ######## you mean a number that is changable then you can use this.
URL GOTO=url~place/something/something/{{!loop}}.jpg
This is an example for link. The key part is {{!loop}} . When you set number of loops and press play on iMacros the {{!loop}} will change from 1 to the number of loops you placed.