When changing themes on a site it could be possible that the registered image sizes no longer exist on your site. This can mean that there might be image size files that exist in your site’s media library that should not exist and those images can be deleted from the media library.
The easy-to-use plugin solution would be the Image Regenerate & Select Crop plugin.
After you have installed and activated the plugin you will need to go to the new admin menu item it adds;
Image Regenerate & Select Crop > General Settings
You can then click on the cleanup unused button. This process might take a while to run depending on how many images are in your media library.
The cleanup feature will clean up all the image sizes you already have on your site but you don’t use these image sizes anymore. Be careful, once you click to remove the selected image size, the action is irreversible, the images generated will be deleted from your folders on your server and database records.
Manage all your WordPress sites with the MainWP Dashboard
WordPress Management for Professionals
All MainWP Pro Extensions are available through one of our convenient bundled packages.
Other handy plugin features include being able to clean up and regenerate for specific registered image sizes. The regenerate button will allow you to all images for specific image sizes. This plugin allows much greater control than using the Regenerate Thumbnails plugin which works well but this plugin has more specific options.
Deleting image files from the media library will be an easy way to clean up files being stored on the site’s server and in the site’s database.