Error while reading the images

This is the error I got while reading the images from the folder -

UnidentifiedImageError Traceback (most recent call last)
in
3 print(path)
4 for im in os.listdir(path):
----> 5 img = image.load_img(os.path.join(path,im),target_size=((224,224)))
6 img_array = image.img_to_array(img)
7 image_data.append(img_array)

~\anaconda3\envs\tensorflow\lib\site-packages\keras_preprocessing\image\utils.py in load_img(path, grayscale, color_mode, target_size, interpolation)
112 ‘The use of load_img requires PIL.’)
113 with open(path, ‘rb’) as f:
–> 114 img = pil_image.open(io.BytesIO(f.read()))
115 if color_mode == ‘grayscale’:
116 # if image is not already an 8-bit, 16-bit or 32-bit grayscale image

~\anaconda3\envs\tensorflow\lib\site-packages\PIL\Image.py in open(fp, mode)
2929 warnings.warn(message)
2930 raise UnidentifiedImageError(
-> 2931 “cannot identify image file %r” % (filename if filename else fp)
2932 )
2933

UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x0000023875916BE8>