Personally I'd try to find some tool that can automatically convert a layered PSD file to animated gif and then make a script that compiles the layered PSD in the way you want.
Thank you, Matias !
the only way is to prepare all of them as layers and in correct order,
thus we can compile them all into animated GIF through script.
Is that correct ?
Edit: The recorded code may seem incomprehensible at first but may actually be helpful nonetheless.