Workaround passing `image` and `u` to `grad_func`