yes, add an "else" statement where check if url contains "photobucket", setting variable $done = 'yes' ... It stops conversion to attachment if image URL doesnt contain "photobucket":
My forum has ~250.000 IMG tags...
I've made some modifications to convert all to attachments, but starting with photobucket only... Next step is try to recover some of old deleted imageshack.us with help of "web.archive.org". :)