Scalability of all-optical neural networks based on spatial light modulators