How can I prevent water from running behind my gutters and under shingles near a wall?
You will probably need professional assistance with this one.  Whether there is a drip edge or not, the shingles should overhang the edge of the roof by about an inch.  The bigger issue is that there is no brick flashing cut into the side of the brick where it meets the roof in the second two pictures.  Some shingles are going to have to come up to correct these problems.  A proper brick flashing should look something like this photo.