Sequential renaming

is there a way to make sequential renaming skip files with existing numbers

i made a script to rename images inside a folder to folder name followed by a sequential number

this generates names like

if i now want to rename some new files that it put in that folder it wants to start with "subfolder_001.jpg" again. is there a way that it continues with "subfolder_006.jpg" instead?

This script should let you do that:

[ul][li]Add a Unique Number while renaming.[/li][/ul]

thanks, but there is still a little problem:
there are not only jpg images but also some pngs. the script only checks for identical filenames but not for identical numbers. So this generates images with the same name but a different extension.