Find a basis for which contains a basis of , where

After row reduction

So I've found the basis for the image of A

How would I find the basis for which contains the image of A

EDIT: Ok so I've just seen the way my textbook does it, and they row reduce the matrix A alongside the identity matrix and then choose the columns from A and the identity matrix (which are the pivot columns in the reduced form).

Why does this method work?