added code to create gif out of images