Image copyright Reuters Image caption North Korea has won 16 gold medals at the Olympics

For a country like North Korea, where image is everything, the Olympic Games present a conundrum.

Victorious athletes - and there have been many over the years - can be used to tout the glories of the nation and its worshipped leaders.

But failure can damage the regime's narrative about itself - and is especially stinging if it comes at the hands of one of the sworn enemies: Japan, the US or South Korea.

If North Korea does compete in February's Winter Olympics in the South Korean city of Pyeongchang, it will represent a diplomatic ice-breaker for two countries that remain technically at war.

For North Korea, which has traded insults and threats with Washington and Seoul over its recent nuclear and missile tests, national pride will be on the line - even though just two athletes have qualified to take part.

No slouch in the medals table

The North has been competing in the Winter Games since 1964 and the Summer Games since 1972, and to put it frankly, the country is no slouch.

It has won 56 medals in total - 16 of them gold. One calculation puts the country at 7th in terms of overall medal success at the Summer Olympics relative to economic output.

Most of the medals have come in wrestling, weightlifting, judo and boxing. Only two, it should be noted, have come in the Winter Olympics.

Media playback is unsupported on your device Media caption North Korea's star ice-skating duo have qualified for the Winter Olympics

Failure must not be televised

In the North, sporting events are almost always shown with a delay - in case the result does not favour Pyongyang.

At the 2014 Asian Games, the stakes could not have been higher. The men's football team made it into the final and were set to face South Korea - the mortal enemy and as it so happened, the hosts.

There was a huge build-up, but in the end the South triumphed 1-0, with the winning goal scored in extra time. News of the match was scrubbed from history.

"They never mentioned the result," says BBC Monitoring North Korea analyst Alistair Coleman. "Nobody in North Korea, as far as official media goes, knows that match result."

What happens if you lose?

Elite athletes are treated very well in North Korea - and if they win at the Olympics, can be well rewarded with cars or even apartments. Victory parades are common and medallists are portrayed as having won due to the great benevolence of the North Korean system, and of course, the glorious leaders.

Image copyright Reuters Image caption Historic selfie: Gymnasts Lee Eun-ju of South Korea and Hong Un-jong of the North took a quick snapshot at the 2016 Rio Olympics

There are rumours that athletes who do badly have been sent to prison camps but analysts caution that this is far from confirmed.

"Failure, at least in recent decades, results in criticism - the state does understand that if it starts sending sportsmen to concentration camps, it will soon run out of sportsmen," said Fyodor Tertitskiy, an analyst for specialist North Korea news website NK News.

"Thus, to my knowledge, in the modern North even if they fail catastrophically, they won't be even expelled from the party (but would have to say a lot of self-criticism during the next ideological meeting)."

While things might have changed in recent years, a Judoka who lost in the final at the 1990 Beijing Asian Games and later defected has said that he was sent to a coal mine because of the loss.

Separately, it appears that there have never been any defections at Olympic competitions. Like diplomats, athletes' families remain back home and would be vulnerable if any sportsperson tried to flee.

Boycotts and bombs

Many countries in the communist bloc, including North Korea, followed the Soviet Union's lead in boycotting the 1984 Los Angeles Olympics, which itself came after the US-led boycott of the 1980 Moscow Games in protest at the Soviet invasion of Afghanistan.

But it was the following Games in 1988 that were awarded to South Korea's capital Seoul that really enraged Pyongyang.

It launched a campaign to have the Games shifted or to have both Koreas jointly host, according to Mr Tertitskiy.

As part of more covert methods to sabotage the South, the regime's agents blew up a Korean Airlines' plane in 1987, killing 115 people.

The North Korean spy who blew up a plane

A female agent involved told the BBC in 2013 that her supervisors said the act "would create chaos and confusion in South Korea" and "would strike a severe blow for the revolution".

Media playback is unsupported on your device Media caption Kim Hyun-hui was once an agent of the North Korean regime

Breaking the ice

If the North does compete in Pyeongchang, the nation's hopes will fall on the shoulders of the only two athletes to have qualified - figure skating pair Kim Ju-sik, 25 and Ryom Tae-ok, 18.

Their Canadian coach has described them as coming to him like a "rough diamond", but told Reuters news agency that "their ultimate dream is to become world champions".

Some analysts see North Korean leader Kim Jong-un's fresh interest in the forthcoming Games as a gambit to bolster the country's reputation after months of sabre-rattling with the US between missile tests.

For the South, having the North take part is a chance to make sure the Games can pass without any disruptive weapons' tests by Pyongyang.

Mr Kim's offer is also seen as an attempt to force a wedge between Seoul and its allies in Washington, who are trying to force Pyongyang to end its missile programme with a maximum pressure campaign.

Reporting by the BBC's Kevin Ponniah