The Victorians were known for taking photos of recently deceased relatives. Especially children. For a view of many of these, simply google "victorian photos of deceased children." The practice did not totally die out with the Victorians, though.
It persisted into the mid-twentieth century, especially among non-Anglo-Saxon and Catholic households with ties to cultures outside the US.
For example, my mother recently passed along to me a photo of her deceased brother Antonio who had died in the early 1940s in Los Angeles. In this case, the photo is quite "tame" by historical standards in that the deceased person is not propped up to look alive, as was the case in many Victorian photos. This is simply a photo of the child in his casket. Note the "Baby Galindo" on the blue ribbon at the center:
In the 1940s, the infant mortality rate was higher for Mexican-American families than it was for non-Hispanic whites, although families of all ethnicities commonly experienced the death of a very young family member. Many families were unfortunate enough to experience the death of a baby or toddler.
On my father's side of the family, for example, my father's brother Peter died as a toddler of pneumonia in 1951. However, by that time, few families continued the practice of photographing dead family members, especially among Anglo-Saxon Protestant types as was the case with his family.
As time went on, of course, infant mortality in the United States became more and more rare, to the point where many people born in the 1960s or later have no memory at all of young relatives dying to childhood diseases. Today, many would consider this practice to be macabre, although back in the 1940s — before the days of ubiquitous photography — a post mortem photograph might be the only photograph one had of one's deceased child.
Que en paz descanse.