Renaming all of the textures automatically

I have a weird issue with textures not being connect to materials correctly. I’ve imported Source map with Blender addon “io_import_vmf”. The textures were imported good enough to be shown in blender.

Imported map from Source, textures are working

(I couldn’t assign multiple medias to the post, sorry)
Imgur: The magic of the Internet

But if I export it into fbx and import into new scene, half of the texture are lost.

Scene after export into fbx, some textures are lost

Imgur: The magic of the Internet

I suspect the cause of this behaviour is wrong path to the texture dublicating original texture path from Source, being imported with use of some unsupported symbols (slashes or something else).

Objects with correct textures are on "root level" of imported structure

Is there an automated way to rename all textures for all materials to remove all of the useless symbols? I’ve looked for existing scripts and I’ve found only this one, which I could edit for my purpose, but I don’t understand, how to change the texture of the material, this script does the opposite of what I need, If I understood it correctly.

Thanks for any help.

(link removed so I could post this…)