Let's change this calling convention: ``grad_func(image, i, j, flag)``