For the kernels, just change the kernel_size argument of nn.Conv2d.
Now this and the changing image sizes will change the output sizes by quite a lot. I would suggest experimenting with the different input sizes and see what breaks in your network, then change sizes accordingly, by hand.
Then when you have it figured out, change them automatically with the image size you give to the network.
If you have a ResNet-like network, the number of inputs of the FC will be different, and that should break when trying different sizes (kernel and image). It might be best for performance to tune the convolution layers to output a constant FC input size. Try different number of layers, number of filters, size of kernels, you can also experiment with non-square kernels depending on the image size… There are infinitely many possibilities here!