Number of layers is reasonable, maybe try 2-3. The number of units in the first 2 layers is way too much. It should be in the tens to hundreds at max. You have to try out different values. This is called hyperparameter tuning, which, in essence, is tuning the parameters not learned by the model from the data. Other examples include learning rate, number of layers, etc.
I also suggest maybe going for a smaller dataset so you can train faster 
After that, I suggest looking at an architecture called convolutional neural networks. These have been the goto for computer vision for quite a while, although recent research suggests that may change soon…
Lastly, I suggest using a platform called Google Colab. This is resource that gives you a free GPU to play around with, which will substantially speed up your experiments. It’s in a notebook format, where you can type and run your code piece-by-piece.