I currently don't have the code. I didn't save it...
I'll give you a rough idea of what the modified code stack overflow did.
They imported pillow module.
Took the 6 labelled images from their storage.
Appended the images with a set delay of 100ms and saved it as one.
I'm not a coder, so I can't remember the python code.