Regenerate Thumbnails - Version 2.2.0
In file regenerate-thumbnails.php locate this, at line 357:
@set_time_limit( 900 ); // 5 minutes per image should be PLENTY
$metadata = wp_generate_attachment_metadata( $image->ID, $fullsizepath );
Add this block of code between the two lines:
@set_time_limit( 900 ); // 5 minutes per image should be PLENTY
// find and delete any previous image-sizes
$info = pathinfo($fullsizepath);
$ext = $info['extension'];
$pattern = str_replace(".$ext", "-*x*.$ext", $fullsizepath);
foreach (glob($pattern) as $filename) {
@unlink($filename);
}
$metadata = wp_generate_attachment_metadata( $image->ID, $fullsizepath );
This will delete any previously generated image-sizes, including older outdated sizes before creating the new sizes.
Important: Note that URLs to images are hard-coded in posts and pages. Removing old thumbnails could result in broken images if they are still used somewhere on your site. You have been warned...
http://wordpress.org/extend/plugins/regenerate-thumbnails/