Most mirrors are attached with an aluminum strip at the bottom that
cradles the bottom of the mirror and picks up the weight. Try to get
the screws (long) into studs. Then, there are a few plastic clips
(again, try to get them into something solid) to secure the upper part
and sides of the mirror. You do NOT want a mirror coming off the wall!
As to the gap, simply caulk it. Something with a little "give" to it,
like latex or silicon caulk will do the trick. Pick a color to suit, or
one that can be painted. Do this before you horse the mirror into place.