Here's a bit of code from another project. The bit from (While) to (Wend) causes the page to stop responding but dratted if I can figure out why. What it's SUPPOSED to do there is check whether the new images belong to the previous listing ID and, if so, skip them until a new listing ID shows up.