I tried the following code  with num_workers = 2 and got this result:
def __getitem__(self, idx):
    print(idx)
    print(self.hf_data.get('X' + str(idx)))
    image = Image.fromarray(np.array((self.hf_data.get('X' + str(idx)))))
    label = torch.LongTensor(np.array(self.hf_labels.get('y' + str(idx))))


    if self.transform:
        image = self.transform(image)

    return image, label

Result
1664
1110
None
<HDF5 dataset "X1110": shape (503, 500, 3), type "|u1">

Which tells me id 1664 is None. If I do:
print(hf_data.get('X' + str(1664)))
<HDF5 dataset "X1664": shape (500, 694, 3), type "|u1">

which is not None.
My HDF5 Version: 1.10.2 is according to the link, so not sure what is wrong.