Problem in creating a Numpy Dataset for Classification problem
If you're going to use an MLP classifier (probably not the best option for image classification: why not CNN?), you should feed it a "flat" array. Each image has 25 pixels (features), so your input must be of shape (n, 25), where n is the number of training observations (10 in your case).

Currently your input is of shape (10, 5, 5) (dimension 3, hence the error message). Try reshaping it like this: X = X.reshape(-1, 25).