I have found an alternative solution by overriding the following file in my own theme folder : vendor/magento/module-theme/view/base/templates/root.phtml
Change the $loaderIcon variable to $this->getViewFileUrl('loader-path.svg').
In my case, i deleted some themes folder in the source code, you can see this error message if you run php bin/magento catalog:images:resize
Required parameter 'theme_dir' was not passed
i re-upload the theme and then re-run the command then everything go fine
First of all, you have to take a backup for the media folder and there is a way to delete unused images is using a module. Here is one that you can use. It is not risk-free, so do a backup first. You can use it from Github free.
Github : https://github.com/...