Improved zoom and pan for GIF and MNG