What is the difference between the run in the terminal and your custom dataset?
Apparently self.image_frame.loc[idx, 'location'] returns a str for the current idx.
I would recommend to check the image_frame in an IDE and make sure the location column contains the expected values, which can be properly indexed.
The previous error pointed to a pd.Series object, while now a str is returned, to maybe it would be easier to create a plain Python list containing all image paths?