The median of {78, 80, 81, 86} is the average of the middle two scores, 80.5.
_____
For the picture, ...
There are 7 scores above the row with stem=8, and 7 scores below that row. Thus the middle score will be the middle score of the row with stem 8.
The median of the scores in the figure is 81.