mod gif logic