Low accuracy on MNIST Dataset
Your model have an accuracy of 0.10 so he is correct 10% of the time, a random model would do the same. It means your model doesn't learn at all. Even a bad model learn a little. So the problem come from your dataset.

I tested your model and got 97% accuracy.

Your problem probably come from how you import your dataset.
Here is how i imported:

import idx2numpy
import numpy as np
fileImg = 'data/train-images.idx3-ubyte'
fileLabel= 'data/train-labels.idx1-ubyte'
arrImg = idx2numpy.convert_from_file(fileImg)
arrLabels = idx2numpy.convert_from_file(fileLabel)


the dataset come from: http://yann.lecun.com/exdb/mnist/

You should test if you imported an processed your dataset correctly. For example :

import matplotlib.pyplot as plt
image = np.asarray(arrImg[1000])
plt.imshow(image)
plt.show()
print(arrLabels[1000])