I’m not sure, if there is an easy way to create patches and reconstruct the input image without padding, if the shapes do not match.
Have a look at this post 228 to see, how to use padding to reconstruct the input again.