basic gif generation code