Any number of horror scenarios may pop into your mind when you think of a midair emergency.
But there's a kind of emergency on a flight that's more common than others: the medical kind.
From heart attacks and seizures to births and deaths, medical emergencies - especially those requiring an emergency landing - do happen.
Experts have struggled to put a figure on the frequency of these incidents, largely because airlines don't have to report them. A 2013 study by the University of Pittsburgh Medical Centre suggested there was one medical emergency in every 604 flights globally, but it could higher.
Emirates, the world's largest long-haul airline, operated 194,000 flights in 2016. In those 12 months, it handled more than 60 medical emergencies that required a flight to be diverted.
Heart attacks, strokes and conditions related to glucose and diabetes were the most common conditions presented, as well as seizures and breathing difficulties.
So what really goes on when someone gets sick? Each airline handles medical in-flight emergencies differently, but this is what happens on an Emirates flight.
No doctor on board? That's fine
We don't know what the chances are of a medical emergency happening when a medical professional just happens to be a passenger on the flight, but Emirates isn't taking them.
The Dubai-based carrier puts its cabin crew through rigorous theoretical and practical training so they can help in a medical emergency, whether there's a doctor around or not.
Their training covers basic life support, emergency childbirth, trauma, and helping people suffering heart disorders, asthma-related conditions, seizures and allergic reactions.
Pilots also get training in hypoxia, malaria, dengue, trauma, basic life support, choking and occupational health.
And there's a lot of medical equipment on board crew are trained to use, including emergency medical kits, oxygen bottles, resuscitators, a defibrillator, and a telemedicine unit.
That's not all - they also have back-up. Emirates has a 24/7 satellite medical advisory service that connects the crew to aviation medical consultants on the ground who can help the patient in real time.
The consultants are on standby to talk crew through the situation, help them make the best decisions and offer the right support.
"It works through a communication from the aircraft to our provider on the ground in a specialist centre through satellite communication technology," Dr Richard Jenkins, Emirates' vice president of medical services, told news.com.au.
"This allows voice communication, as well as the transmission of medical information such as ECG and blood pressure from our telemedicine technology.
"We can also support a video consultation between the ground-based doctor and the patient in the aircraft."
But if there happens to be a medical professional on board when there's an emergency, will they be allowed to volunteer their help?
"Yes, on the request of the ground based advisory service after they have assessed the
situation first," Dr Jenkins said.
"There are certain times where an on board medical professional can be helpful and support the ground based team and the Emirates crew."
It's really, really expensive when someone gets sick
Not all medical emergencies result in the flight making an emergency landing, but many do.
And it could cost Emirates anything between $64,000 to $780,000 each time it happens, depending on the situation.
The massive sum includes the cost of fuel, flight catering, landing and ground handling fees, air navigation costs, passenger recooking costs, onward connection costs and extra costs for cabin and crew.
"We can never hope to recover the costs of a flight diversion, but the wellbeing of our customers is always our number one priority," Emirates' executive vice president and chief operating officer Adel Al Redha said.
"The safety of our passengers comes first. If there is a medical emergency on board, our crew have the training and equipment to help them assess the situation, and deliver the best possible outcome for the affected passengers."
The airline's in-house team of aviation medical specialists, flight planners and operations controllers work together on scenario planning and diversion protocols.
"If we have to divert a flight, our aim is to get medical attention for the afflicted passenger as soon as possible," Mr Al Redha said.
"With our medical advisory consultants and Emirates' own operations control team, we identify the best location where the passenger may receive appropriate care, and where the airport can adequately support the passengers and aircraft."
Mr Al Redha said flights may be diverted to a place where medical costs were expensive, so travellers should keep that in mind when making travel insurance plans.
What happens when someone dies?
It's a grim prospect, but people do die on flights.
It doesn't happen often: the University of Pittburgh study found only one-third of 1 per cent of mid-flight medical emergencies resulted in death.
But flight crew have to prepare for that possibility as well.
"Our crew are trained to deal with the unfortunate event of a death in flight to ensure the
passenger, any accompanying family members or friends and the other passengers are
managed with care and empathy," Dr Jenkins said.
And what about when someone is about to give birth?
This happens too, which is why flight crew are trained in emergency childbirth, and have the 24/7 satellite advisory team ready and waiting to help.
And it can be a pretty incredible experience for everyone involved.
"We actually had a birth of a baby on board an aircraft where one of our own Emirates clinic doctors was travelling on the aircraft on vacation," Dr Jenkins said.
"With the support of the ground-based advisory service our doctor supported the delivery a healthy baby on board while the aircraft was still in flight."