While updating IDs thumbnails are not updated.
To do so, you can add this code after _update wp_termrelationships with new id code:
//if post's thumnail, update it too
$result = $db->query('UPDATE '.WP_PREFIX.'postmeta SET meta_value='.$post_new_id.' WHERE meta_key="_thumbnail_id" AND meta_value='.$post_old_id.';');
echo ($result ? "Updated ".WP_PREFIX."thumbnail for #".$post_old_id." \n" : "FAILED: \n".mysql_error()."\n");
While updating IDs thumbnails are not updated. To do so, you can add this code after _update wp_termrelationships with new id code: