Feeding images from csv files to the neural network

I have a huge amount of data in the form of a csv file where the image is reshaped to a single row(a 50X50 image is reshaped to 2500X1 row) and saved in a csv file, with the final column deciding the class. The csv file contains 2501 columns and n rows(n = no of images).
Is there a way to create image DataBunch from csv without saving the images separately from the csv files.

Check lesson 5 mnist dataset loading.