Fixed bug with crashing on some gifs. (the problem was with pairGCD() method)