Error in Convolutional Neural network for input shape
The convolution operation used in CNNs are batch operations. The customary inputs for these networks, at least for Keras and Tensorflow, are channels last and channels first. The first dimension specifies the number of data in your batch, the second and third can be height and width if you choose channels-last and the last one will be the number of channels of your input, for instance the number of channels for grey-scaled images is one whilst for coloured images is three. If you use channels first, the first dimension would be the number of data in your batch, the second would be the number of channels and finally, the third and fourth dimensions would specify the number of height and width respectively.

For your case, it seems you are using MNIST data-set. What you need to do is just reshaping your input images to one of the standard mentioned manners. You can resize your input to (1000,28,28, 1).