MRI is more sensitive for identifying intracranial problems, however it can pick up brain abnormalities that are not relevant to the persons headaches.The American College of Radiology recommends the following imaging tests for different specific situations:

Lumbar puncture
A lumbar puncture is a procedure in which cerebral spinal fluid is removed from the spine with a needle. A lumbar puncture is necessary to look for infection or blood in the spinal fluid. A lumbar puncture can also evaluate the pressure in the spinal column, which can be useful for people with idiopathic intracranial hypertension (usually young, obese women who have increased intracranial pressure), or other causes of increased intracranial pressure. In most cases, a CT scan should be done first. Classification
Headaches are most thoroughly classified by the International Headache Societys International Classification of Headache Disorders (ICHD), which published the second edition in 2004. The third edition of the International Headache Classification was published in 2013 in a beta version ahead of the final version. This classification is accepted by the WHO.Other classification systems exist. One of the first published attempts was in 1951. The US National Institutes of Health developed a classification system in 1962. ICHD-2
The International Classification of Headache Disorders (ICHD) is an in-depth hierarchical classification of headaches published by the International Headache Society. It contains explicit (operational) diagnostic criteria for headache disorders. The first version of the classification, ICHD-1, was published in 1988. The current revision, ICHD-2, was published in 2004. The classification uses numeric codes. The top, one-digit diagnostic level includes 14 headache groups.
People with progressively worsening headache also warrant imaging, as they may have a mass or a bleed that is gradually growing, pressing on surrounding structures and causing worsening pain. People with neurological findings on exam, such as weakness, also need further workup.The American Headache Society recommends using "SSNOOP", a mnemonic to remember the red flags for identifying a secondary headache:
Systemic symptoms (fever or weight loss)
Systemic disease (HIV infection, malignancy)
Neurologic symptoms or signs
Onset sudden (thunderclap headache)
Onset after age 40 years
Previous headache history (first, worst, or different headache)Other red flag symptoms include:

Old headaches
Old headaches are usually primary headaches and are not dangerous. They are most often caused by migraines or tension headaches. Migraines are often unilateral, pulsing headaches accompanied by nausea or vomiting. There may be an aura (visual symptoms, numbness or tingling) 30–60 minutes before the headache, warning the person of a headache. Migraines may also not have auras. Tension-type headaches usually have bilateral "bandlike" pressure on both sides of the head usually without nausea or vomiting. However, some symptoms from both headache groups may overlap. It is important to distinguish between the two because the treatments are different. The mnemonic POUND helps distinguish between migraines and tension-type headaches. POUND stands for: 
One review article found that if 4–5 of the POUND characteristics are present, a migraine is 24 times as likely a diagnosis than a tension-type headache (likelihood ratio 24). If 3 characteristics of POUND are present, migraine is 3 times more likely a diagnosis than tension type headache (likelihood ratio 3).