Based on the error message, it seems you don’t need to add the file extension again, as the file path already contains the .jpg extension:
img = Image.open(self.img_path + self.X_train[index] + self.img_ext)