You can input images of different sizes to keras easily, but some changes to code is required for that: .
You can change your input shape to shape=(n_channels, None, None).
Here n_channels is the number of channels in your input image.
If you are using TensorFlow, you might have to change it to (None,None,n_channels)
You should use:
input_shape=(1, None, None)
For example, using keras functional API, your input layer would be:
For an RGB dataset
inp = Input(shape=(3,None,None))
For a Grayscale dataset
inp = Input(shape=(1,None,None))
Hope this answer helps.