Edit: just noticed it's for vBulletin 5... nvm.
I originally thought this was for vBulletin 4,
so this will not work for your forum, but I decided to just post the script here anyway:
You could use something like this in PHP to mass rewrite IMG tags that look like:
[img width=123 height=123
] to
[img
]. Create a PHP file in the root of your forum and then visit it in the browser or execute it through the command line interface.
I recommend executing it against a test database first since I didn't test it.
Also if you have a very big database, it may timeout.
PHP Code:
<?php
require("./global.php");
set_time_limit(360);
$q = $vbulletin->db->query_read("SELECT postid, pagetext FROM " . TABLE_PREFIX ."post WHERE pagetext like '%[img %]'");
while($row = $vbulletin->db->fetch_assoc($q)){
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "post
SET pagetext = '" . $vbulletin->db->escape_string(preg_replace("/\[img\s(width=(...)\sheight=(...))\]/im", "[img]", $row['pagetext'])) . "'
WHERE postid = " . $row['postid']);
}