Directory = 'Images_folder';
Imgs = dir(Directory);
thisname = Imgs(j).name;
thisfile = fullfile(Directory, thisname);
Img = imread(thisfile);
Im = Img(:,:,1);
Remember, image files are defined by their content, not by their extension, so the only sure way to determine if any given file can be read as an image is to try reading it as an image.
Myself, I would at the very least filter out directories before making the attempt, but I do not know Windows well enough to be certain that it would refuse to read a directory as an image.
This code is deficient in that it can only read the image types handled by MATLAB, not all types of images as you had asked for.