I presume you used a script to rename 1000+ images, so you could probably apply your same rules to a MySQL update query on the wp_postmeta
and wp_posts
tables using a REGEX or a series of REPLACE()
statements.
Saves
You can do this with a SQL GUI tool, in phpMyAdmin or using WP CLI
Saves messing about with Wordpress functions.