How to transform a folder of images in a csv file
You are describing a one-time pre-processing step that will crawl through your folder and turn each image into a line of data and then save the entire collection in a CSV file. In turn, that file becomes your gold standard dataset. 

If I was in your position, I would look into the Keras pre-processing tools that already provide python libraries to quickly do this task. It's a common need for image processing, the Keras library is very mature and can do this for you.