Limit number of images to upload in wp.media function

Limit number of images to upload in wp.media function

error code: 523