There is adjustment designed into the hinge and the hinge backing plate. If the door closes correctly and the gaps are suitable, replace one hinge at a time, thus holding the door in the correct location. Use a fine point scratch awl, to trace around the edge of the hinge before you remove it. When installing the replacement hinge, put it back in the original location, identified by the scribe lines. I would do the top one first, followed by the bottom hinge.

I hope this information is helpful and let us know how you make out.