You should make sure that the reshaping doesn’t change the number of samples, but reshapes the images tensor in such a way, which would e.g. increase the sequence length or the number of features.
Usually the important size during reshaping operations would be the batch size, which should stay the same. The shapes or other dimensions depend on your use case.