Restricting file upload in Media Library using specific mime types. For example , only jpeg and png files

I also need to restrict media libary file upload based on mime types. is there any way work around?