preliminary gif encoding works