I have Created a form to upload images, where i should display error message if i upload more than 3 images and should disable submit button
Follow the steps

Go to image field settings of you content type.

Then Go to Image Field Settings and select '3' for number of values for the image



That's it. When user reaches their upload limit (3) the submit button will be disappeared automatically. and display like follows.