The picture is not very clear to me but if you have a door fixed to a door frame that is connected to the wall and there is a gap between the frame and thewall you should bridge the gap by fitting architrave around the door frame (it comes in various widths) fix the architrave to the door frame...