I think Demento has answered it well, but probably below can add some more understanding to you.
[1] Usually the data stored for image processing relates to the Image Pixel Densities(as per the many courses i visited online), which can be very well maintained using a matrix of pixel density values, corresponding to the resolution of each image.
Then it depends on the image's color spectrum (is it a colored or a gray scale); as per the case of hand written text recognition you don't really require the pixel values for a colored image.
Consider that if you have a colored image then you have to store the RGB values for each pixel, thus tripling the matrix size, and the training could be very well done with just the gray scale values, thus it would be better to convert all the images to gray scale in preprocessing step and also take care to convert the image to gray scale when you actually use the trained network to recognize an image (just a novice mistake!).
As per the storage for the required matrix form of the pixel density values, a flat file storage would suffice, but I would recommend libraries instead (if working in python or other alternatives), like pandas and numpy. For these libraries provide a robust solution for data management and retrieval.
For more details - https://docs.scipy.org/doc/numpy-dev/user/quickstart.html
https://github.com/pandas-dev/pandas
[2] Now I would emphasize on why not to use any DataBase(DB) for the storage of such information.
Firstly the integration of it would only result in an unnecessary overhead to your efforts of training the Network and also when you would want to recognize an image(which would always be a single matrix form of it's Image Pixel Densities), you would require the connection to the same DB and would also need to make an insertion to it first, for the script to be able to extract from there and make recognition(not recomended).
There is a fact we don't really concern ourselves with is the quality of the training image dataset, we do ignore the presence of noise in the dataset(would be minimum if using a preprocessed standard data set such MNIST http://yann.lecun.com/exdb/mnist/), but if creating one's own data set we have to consider noise and rectify accordingly in the preprocessing task itself.
With noise I mean loss or overlap of pixel density information which is usually adds a blurring effect to the images, and can seriously damage the training metrics.
To overcome it, there are approaches to rectify the pixel values with a prior learning methods such as extracting data from obfuscated images,
see link- https://arxiv.org/pdf/1609.00408.pdf.
With the above case you would require to make updates in the DB for very single record in the preprocessing task even before you start to train the Network, thus it can increase the total requests to the DB in multifolds and thus impeding the whole benefit of using it in the first place.
I suppose the above should give you fair idea, about the kind of data to store and the Data Storage to prefer accordingly.
I worked out the Digit Classification using MNIST data set with obscuration using a NN Pipeline, to refer https://github.com/kchopra456/Digit-Classification-and-Image-Obfuscation-ANN.