writes images to gif animation