(Urgent) Repacking Dataset after Modifications

I am performing some transformations on the Cifar10 dataset. Is there a way to repack the dataset in its original format?

I have searched for this extensively but could not come up with a solution. I am aware that I could save images and read them using ImageFolder class. But, this has certain limitations, only repacking will be compatible with the codebase.