If you go for an MRI scan in the UK you will be given what's known as a "Contrast Dye" to improve the scan images. This contract agent is usually gadolinium-based. A recent report questions the safety of gadolinium-based contrast dies.
Gadolinium is a heavy metal and the contrast dye containing it usually passes through the system in a short period of time.
In some cases, the body doesn't get rid of the contrast dye very quickly and this can lead to aches and pains, including headaches and migraines.
Note 12 December 2016
New research relating to the repeated use of contrast agents in MRI scans as relating to deposits on the brain of those with Multiple Sclerosis (MS) suggests that the risk is reduced if 'macrocyclic agents' are used.
Note 13 July 2017
In a study published in July 2017 states that researchers from MIT and the University of Nebraska, “have now developed a metal-free contrast agent that could be safer to use in those high-risk groups. Instead of metal, this compound contains organic molecules called nitroxides.”
“Furthermore, the new agent could be used to generate more informative MRI scans of tumors because it can accumulate at a tumor site for many hours without causing harm.”
Image: By Gadolinium table image created for Wikipedia by schnee on June 24, 2003, 11:26 UTC. [Public domain], via Wikimedia Commons