HALF a century, more or less, has passed since Nick Hedges’ camera recorded the evocative images you see on these pages.

Taken, in the main, in Glasgow and the west of Scotland, they show some of the conditions endured by people who lived in tenements. A number of the images evoke slums: broken windows, kids playing in run-down back-courts, grey monolithic housing blocks that put you in mind of eastern Europe.

Commissioned by Shelter in 1968 to document people’s housing conditions, Hedges spent three years visiting some of Scotland's poorest and most deprived areas. One Maryhill family told him that they slept with the lights on to keep rats at bay.

Now that he has lifted a 40-year embargo on his work – it was put in place to protect the young children he photographed – the pictures form a powerful exhibition, organised by Shelter Scotland, that has just opened in Edinburgh. Its 20 images represent a fraction of the 1,000 Hedges shot all those years ago. The pictures shown here do not appear in the exhibition.

“There were some really bad tenement blocks in Glasgow at the time,” he recalls. “The Gorbals, obviously, but Maryhill was bad as well: its courtyards were ankle-deep in rotting garbage.

“Each year Shelter decided what sort of feature, related to bad housing, it wanted to look at: it might be children, education, health, poverty, whatever. And on that basis they’d decide which cities they would look at.

“In 1969, 1971 and 1972 we covered Glasgow and Edinburgh, amongst other British cities. I’d find out where the worst areas of housing were then spend several days knocking on doors, talking to people and setting up interviews. Most people were pleased that someone was taking notice. Shelter had a public presence so the charity wasn’t an unknown quantity. People were generally pretty open to being interviewed.”

Hedges remembers being appalled by some of the slum conditions he encountered, and feeling sympathy for those who had to live in them.

“When I was a college student I had already determined that I wanted to work in documentary photography. There were various historical examples of photography making a difference, such as the work done by the Farm Security Administration during Roosevelt-era America, chronicling migrant workers who left Oklahoma to seek work in California. That was what inspired me.”

In the Gorbals, in what Hedges thought was an empty vista of tenements, he met a woman, a Mrs Harley, as she hung out the washing. Her baby was in a pram nearby. The Harleys were the block's last occupants. “I couldn’t believe she was still living there. She told me how they had woken up one morning and hearing a great crashing sound – a demolition ball was being swung 40 or 50 yards away down the block. The workmen had no idea there were people still living there. The Harleys stopped the demolition but still had to be rehoused. I called back some months later. They were still there, despite frequent visits to the council offices."

Across Britain, people like the Harleys were living with the legacy of 19th-century housing. In the early part of the 20th century, says Shelter, much of Scotland’s tenement housing was cramped and unsanitary, with entire families confined to just one or two rooms lacking basic amenities. In Glasgow, a single toilet might be shared by 30 people.

A government housing act in 1919 promised to improve such wretched conditions. Knightswood, for example, was built in 1923 to alleviate some of the pressures on tenements. Across the country, private housebuilders built homes, which were bought by better-off families.

Slum clearance was carried out on a large scale, and the council house was born. As Sir Tom Devine notes in his book The Scottish Nation 1700-2000, fully 70 per cent of the 344,209 new houses built in Scotland between 1919 and 1941 were owned by local authorities.

But even in 1936, notes Shelter, a survey found that almost half of all homes in Scotland were inadequate. Housebuilding ground to a halt in the war, but in the post-war years, determined efforts were made to tackle slum housing once and for all. The solutions, first, were outlying schemes such as Drumchapel, in Glasgow, and Niddrie, in Edinburgh; New Towns formed a second, later wave.

Hedges' photographs brought back memories for me. I spent my first eight years in a ground-floor tenement flat. Our home was small but spotless. We shared a toilet – cold and damp – with other families in the close. The back-court, where kids played under the eye of a mum watching from her kitchen, had middens, and threadbare patches of grass, and no trees. Looking back now, it seems desolate; but at that time, at that age, I was happy. It was home, after all. It never occurred to me to think that other people’s homes, in other streets, might be more glamorous, or warmer, or larger.

My family moved to a more modern house in 1968. It was the small things that made a difference: thick carpets on the stairs, gardens to the front and back, an inside toilet. No more shared bedrooms, either.

Two years ago I went back to my first home to see what had changed. Even on a sunny midweek morning it looked resolutely gloomy. Then, a few weeks ago, in an estate agent’s window, I noticed a sign: five of the properties in the old street could be bought together for around £100,000, to do up. I thought: £100k for five homes? Is that all they're worth?

The wider picture, of course, is that, yes, overcrowded tenements could give rise to all sorts of unattractive situations; but the upside was that they often had a real sense of community. You were rarely lonely in a tenement: you always met someone on the stairs, or while queuing for the toilet. People stood and chatted in the close mouth. I have a distant memory of Hogmanays being particularly festive occasions.

There's a wise line, too, in Sir Tom's book, about the tenements of old: built in stone and substantially constructed, he writes, they protected residents against adverse weather. They were easy to heat, and tenants above ground level were less likely to suffer from damp conditions than people who lived in croft houses or farm cottages.

And not all of Nick Hedges’ photographs automatically speak of deprivation. There’s one joyous shot of children playing on swings against a backdrop of the Govan shipyard cranes. It’s a lovely image, one that irresistibly suggests the innocent pleasures of childhood.

Over time, Glasgow got rid of many of its tenements, but not all of them. One friend of mine has lived for years in a top-floor tenement flat in Glasgow's south side. The stairs are a nightmare, but she adores her large, airy, high-ceilinged rooms, her spacious kitchen, the close bonds she has formed with neighbours.

And not all the solutions to overcrowded tenements succeeded. The Red Road flats were a radical idea for their time, but they belong to the past now. Last weekend, the six remaining tower blocks were demolished, even if two of them were left partially standing.

So was anything was lost when tenements were replaced by high-rises? “A home isn't just a roof over your head," says Adam Lang of Shelter Scotland. "Homes need to be safe, warm and affordable, and within neighbourhoods which have access to local amenities, healthcare and support networks. Yes, inside toilets and warm homes are good news, but there was a long way to go to building communities that could thrive in the long term. This applies as much today as it did in the 1960s and 1970s.

“Scotland still has a severe shortage of affordable homes. Tomorrow 5,000 children will wake up homeless in our country. To meaningfully tackle the housing crisis we need to build at least 12,000 affordable homes each year. Only then can people without a home, and those living in poor quality housing, have hope of a safe place to call their own.”

Back to where we came in. Does Nick Hedges think his photographs had any impact? He believes they certainly did not do any harm. “Shelter published its annual report at the time of the main party conferences, and it would have lobby meetings at them to discuss housing issues,” he says.

“I remember being pleasantly surprised that at a Liberal Party conference, one speaker waved the annual report, with one of my photographs on the cover, at the cameras, saying: "This has got to stop – we have to change our attitude towards bad housing." That was an extraordinary thing to see.

“It was important that governments did take notice. I won’t say it was a result of the photographs – it was a result of the Shelter campaign that legislation was brought in in terms of housing. And Shelter was able to raise large sums of money, which it gave to housing associations to build social housing.”

Make Life Worth Living, sponsored by PwC, is at St Andrew Square, Edinburgh, until October 30

http://scotland.shelter.org.uk/