import subprocess
shapes = ['lip_shapes1.png', 'lip_shapes4.png', 'lip_shapes11.png',
    'lip_shapes3.png']
cmd = ['convert', '-loop0'] + shapes + ['anime.gif']
retcode = subprocess.call(cmd)
making a GIF from imges in any order with python