Remove useless `pat` and `img` pointers.