After spending almost a year in one of Mexico's most feared maximum security prisons, Jorge Cueto-Felgueroso knows a thing or two about dealing with adversity.
In 2012 he was charged with fraud, and thrust into the midst of 13,000 inmates at Puente Grande Prison, in central Mexico.
Mr Cueto-Felgueroso, a lifelong entrepreneur, was faced with a stark choice - sink into depression or worse, or find the best way to survive. He chose the latter.
"Even in the most adverse circumstances you can find the formula for success," he says.
Struck by how many of the inmates had tattoos, and the fact that much of the ink work had been done while behind bars, using the rudimentary tools available, Mr Cueto-Felgueroso came up with the idea of using the same methods to transfer designs onto leather.
So he started paying the prison tattooists to imprint designs onto leather bags and wallets
By the time Mr Cueto-Felgueroso was found innocent and released 11 months later, he'd amassed 650 such items, which he used to set up a social enterprise called Prison Art.
The business now sells up to 600 bags, wallets and purses a month, all tattooed by prison inmates, and retailing at up to 6,500 pesos ($390; £261).
Inmates who work on the bag designs can earn up to 6,000 pesos a month - well above the typical government salary for prisoner jobs such as cleaning and maintenance, which pay as little as 50 pesos per week.
Two years after Mr Cueto-Felgueroso left prison, the brand now has four shops, including an outlet in one of the most luxurious hotels in the historic centre of Mexico City.
And in total the business has generated more than 200 jobs inside and outside the prison. In fact, those who have been released often go on to get jobs in the small factory near the prison, which also now makes t-shirts.
With profits reinvested back into the business, Mr Cueto-Felgueroso says his main motivation is to provide "decent work" for inmates, offering them a way out other than crime.
The 48-year-old says: "The problem in Mexico is that guilty and innocent people are mixed for a long time in prison, criminal proceedings are very long.
"[There are] no opportunities and decent work, and for many, joining the ranks of crime is the only way out."
Prison Art isn't the only venture offering Mexican prisoners an opportunity for rehabilitation. At the Santa Marta Acatitla men's prison in the eastern part of Mexico City, an amateur dramatics group has been turned into the first professional theatre company inside a Mexican prison.
The venture originated through four amateur workshops offered by independent theatre group Shakespeare Forum, founded by Mexican actors Bruno Bichir and Itari Marta.
The men's prison troupe has gone onto perform three professional productions since 2010. These are open to the general public, who, as part of their 200 pesos ticket price, are bussed into the prison from downtown Mexico to watch the performance.
The money generated from the theatre shows has enabled actors, set designers and stagehands to receive a salary, and in all has generated employment for 35 people, both inside and outside prison.
But the social enterprise project is much more than a source of employment, it is "a lifetime chance" for inmates to escape the "black hole" of prison, says Ms Marta, 39.
She and Mr Bichir started working with the prisoners after some inmates go in touch to invite them.
Israel Rodriguez, who was released from Santa Marta Acatitla prison five years ago, says the theatre company helped him transform his life.
After serving an 18-year sentence, he had nothing, and little chance of employment, but the Shakespeare Forum offered him a job as a security guard, whilst he trained as a professional actor.
The chance has enabled him to break away from the stigma of being an ex-prisoner, and since then he has moved on to work on productions with other theatre companies, and he now helps to lead the prison theatre company.
Hands Weaving Dreams, a brand of bags, decorative items and furniture, was started with a similar aim to offer prisoners, in its case female ones, hope.
Sisters Claudia Martinez-Erazo, 47, and Diana Martinez-Erazo, 42, started the firm seven years ago, with just 1,500 pesos, after Claudia lost her job.
They started to employ female prisoners upon the recommendation of their aunt, who volunteered at a prison.
Female prisoners across Mexico now make Hand Weaving Dreams products, which are sold in major Mexican department stores, and also exported to both the US and Europe.
Diana, who studied architecture, is in charge of the design of the products, while Claudia manages the business side of things at the for-profit venture.
Claudia says they pay the prisoners fairly for their work, enabling the women, who often have no other means of financial aid, to send out money to help care for their families and children.
Diana adds: "One of the biggest challenges was to try to help them without weighing stereotypes. Not to see them either as victims or as criminals but as artists, as creative workers.
"It is not my role to judge them or save them. We need to work with them to give them a dignified choice to move forward."
Taller Nu - a clothing and shoe brand started in 2012 by fashion design students Pilar Obeso and Olga Olivares - also use prisoners to help make some of its products.
The co-founders decided to do this after holding a workshop in a prison, and because they say they wanted the firm to have a positive social impact in their local community.
The for-profit business sells its creations in fashion stores in Mexico City, New York and Tokyo, as well as online.
As the business grows, Ms Obeso, 26, says they will continue to use prison inmates.
"Our model seeks to generate jobs, training and productive skills for prisoners, helping them to better integrate into society when they are released."