EPiServer gives our users a tremendous amount of power and flexibility. However users can occasionally do things that may affect performance or their experience of EPiServer. One of these things is adding a large number of images/documents into a folder in the media library. By adding too many items to a folder the folder not only becomes cumbersome to browse and use but can also affect performance in extreme circumstances. 

So if you would like to prevent users creating folders with too many images then the following EPiServer initialisation module can be used to restrict the number of images/documents in all media folders:

The error message then shows up in the UI in two ways.

When moving files:

When uploading files:

This is just a simple example of how this can be achieved and your exact requirements may differ.