title: UnidentifiedImageError: cannot identify image file in CovidX dataset
body: <p>I am using the CoViDx dataset. When I try to open images, sometimes it works well, sometimes it prints the error in the title: <code>UnidentifiedImageError: cannot identify image file</code>.
  This is the code. My covid dataset class:</p>
  <pre><code>class CovidDataset(Dataset):
      def __init__(self, dataset_df, transform=None):
          self.dataset_df = dataset_df
          self.transform = transform
          
      def __len__(self):
          return self.dataset_df.shape[0]
      
      def __getitem__(self, idx):
          image_name = self.dataset_df['filename'][idx]
          img = Image.open(image_name)
          label = self.dataset_df['class'][idx]
          
          if self.transform:
              img = self.transform(img)
          return img, label
  </code></pre>
  <p>Then <code>train_dataset = CovidDataset(train_df, transform=image_transforms['train'])</code> and when I do <code>train_dataset[0]</code> it prints:</p>
  <pre><code>(tensor([[[-0.1433, -0.1312, -0.1072,  ..., -1.2137, -1.2017, -1.2017],
            [-0.1673, -0.1312, -0.1312,  ..., -1.2017, -1.2137, -1.2137],
            [-0.1673, -0.1433, -0.1312,  ..., -1.1776, -1.2137, -1.2137],
            ...,
            [-0.7687, -0.7807, -0.8048,  ..., -0.6725, -0.6965, -0.6725],
            [-0.7446, -0.7687, -0.7807,  ..., -0.6604, -0.6965, -0.6845],
            [-0.7446, -0.7567, -0.7927,  ..., -0.6604, -0.6965, -0.6845]]]),
   'negative')
  </code></pre>
  <p>Instead, if I do <code>train_dataset[1]</code> I have this error: <code>UnidentifiedImageError: cannot identify image file 'train/sub-S03144_ses-E06258_run-1_bp-chest_vp-ap_dx-corrected.png'</code></p>
  <p>So, going on, some images are opened, while some other images do not work. How can I fix this? I have already seen this post: <a href="https://stackoverflow.com/questions/63754311/unidentifiedimageerror-cannot-identify-image-file">link</a> however, I have this error if I apply the script in the answer: <code>NotADirectoryError: [Errno 20] Not a directory: 'train/37ae5f8b-8504-479e-bdbd-58dc6158f0f6.png'</code></p>