With a pencil, mark the points on the wall where you’re going to insert the nails.
If you’re in any doubt, use a spirit level to make sure they’ll be on a level plane.
When you’re happy, hammer in the nails.
Note: They’ll need to be deep enough into the wall so that the sticking-out part of each nail isn’t longer than the depth of your frame.