It seems that imftype is called by imread to determine the file format. As a workaround, have you tried explicitly stating the file format since all your images are .jpg:
img=imread(imgFiles(j).name,'jpg');
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!