done with gif decoding function