How to decide number of Layers and Units in a Layer?

No, that’s not correct.

The 400 input pixels are being weighted and combined into 25 separately trained units.

All 400 pixels are input to each unit.