I want to create a model which can classify these images

X_train shape is (7230, 21, 21) having arrays of 21x21 as input.
I thought of using pre-trained model (transfer-learning), but these image arrays are of size 21x21 and in every model in transfer-learning there is requirement for bigger image (around 224x224).
I tried to classify it using this sequential model
model = Sequential([
layers.Conv2D(32,(3,3), activation='relu',input_shape = (21,21,1)),
layers.MaxPooling2D((2,2)),
layers.Conv2D(64,(3,3),activation= 'relu'),
layers.MaxPooling2D((2,2)),
layers.Flatten(),
layers.Dense(64, activation='relu'),
layers.Dense(9,activation='softmax')
])
But this model is not working. Any solutions?