All images used in WordPress website have got a URL and WordPress automatically created a URL for a landing page using the image.php file. So protecting to index all images with dedicated pages URL I removed all code and redirect all images link to the homepage. Which is working fine whenever someone clicks on the image link it automatically redirects to the homepage.
But the image's URL are not getting deindexed from search results. So that is damaging website and getting bad redirect messages on websmater.
Can anyone help me how I can deindex all images from SERP? Want to deindex all URLs so that I won't need to redirect these URLs to the homepage.