Validation of form whoch is a image

I don not let upload the file which are not images
I need only jpg gif and png
how to do that
I am confuse => google.com