如何检查上传的图像是否是所需图像而不是任何其他不良图像?

I am building a website where a user can lodge a complaint regarding garbage problem at his/her place by uploading a photo of that garbage.

I want a mechanism or a code by which I can check and verify that the uploaded image is an image of garbage and not any other undesirable image.

I am using PHP language in my project. Can somebody suggest a PHP code or any other appropriate code to carry out above verification?

Please help...