Hi again, sorry I don’t get earlier that you were referring to the real structure of the data itself.
Look for the subject on the page bellow : FILE FORMATS FOR THE MNIST DATABASE
There you can understand better how the data is hold inside the files to create yours.
http://yann.lecun.com/exdb/mnist/ 61