It does require core edits, Lex- had the same problem. Since it is in a function, it cannot use continue; since the loop is somewhere else. Trust me, I have tried multiple other ways, a core edit is much easier than any other way.
Oh, and I changed the active image.
Oh, and I changed the active image.