why is there a gap between the carpet tack strip and the wall?
Usually the tack strips are away from the wall to provide room for the carpet to go over the tacks then under the mouldings. It looks like your mouldings are flush on the wall but that could just be my phone not providing enough resolution.