I think this is an interesting question. Personally, I wouldn't want photos of my dead body online, I don't want the people closest to me live/relive the trauma nor letting the public see and do whatever they want with my body.
However, I say this poses an interesting question because it can be analyzed and argued from different points of view, and the significance (or insignificance) of the body.
I'm gonna go in a little tangent and it's probably gonna be long, but bare with me lol
There have always been stories in the newspapers about people who have died horrific deaths, but it wasn't until the end of the 19th century-beginning of the 20th century that, with the mass production and availability of the camera, that it became possible to capture and print the end result of those unlucky folks. And it wasn't until the middle of the 20th century that this tendency would gain more traction.
In my country, a very sensationalized and shocking form of journalism would emerge, one with scandalous photos and very graphic pictures, retelling real stories of horrific accidents or murders. This was obviously apalling to the general public, but it had a reason to exist: in those times, the media in the country was heavily controlled and censored by the government, so newschannels would omit stories that would paint the current leadership in an unfavorable light. This form of journalism, although very controversial, served to inform the general public of some of the real situations in the country, those the government didn't want to recognize.
Besides, in many situations where a gruesome death would occur, a crowd would sometimes form around it, the photographer would simply go into the crowd and take tje photo, at least they had reasons to take the photo, their job, but what was everybody else doing there?
Flash forward to the late 90's-early 00's. with the availability of computers in households, more people would be able to create and access any site they may need. And with that, came the ability to post questionable content, which lead to legislations being created. Which in turn, fueled protests from users. For example, Rotten dot com was made to exclusively hold gorey photos as a form of protest, since laws trying to censor or prohibit content were extremely ambigous. Most people dislike gore, but, to an extent, its existance is necessary for somethings, such as medical students who need to view graphic illustrations or photos of the human bodies. Acts like these and the failure of these laws led to the creation of more webpages dedicated to gore content, which would proliferate until the 2010's.
But things had changed since the 90's. Not only were we starting to be more conscious about certain topics, but the necessity around websites like Rotten and other gore sites began to diminish. It was no longer considered protest, but mere exploitation. Not to mention, we could also see the negative effects in societies constantly struck and filled with violence, violent stories and violent imageries. Laws were being passed around the treatment of these photos, respect for the dead and their family began to be a driving force, as well as mental health. Times have changed and their purpose in society has also been recontextualized.
I feel you could also take into account the cultural, ceremonial and artistic meaning of the bodies of the dead.
In non-white cultures, the traditions and beliefs around the dead and their bodies are different, they may have specific rituals or places to bury them and let them rest. However, because of the history of colonialism in the western world, many times have non-white bodies been disrespected, their tombs destroyed and their rituals banned; plus, exploitation of their tragedies for a white audience's entertainment.
The artistic or photographic depictions of their dead by the hands of the corresponding culture(s) can be viewed as a sort of reclamation and justice for the ones who have passed.
And just before I wrap this long ass post, I want to elaborate about the artistic use of the dead body.
It is very controversial because it depends on the artist and their intention, as well as the medium. Some corpses might simply be painted, others are photographed, sculpted, or maybe even, the body or their residuals on themselves are used. I don't remember names, but there is one artist who receives donations of dead bodies to remove their skin and pose them. with (I think) artistic and medical purposes (for studying). From what I know, the donations are from people who have passed but consented to use their bodies this way. There is also a mexican artist who creates instalations (I think) which splash with the odor of blood taken from mortgages and stuff like that, from people who have been killed by organized crime; though, I am not sure if she receives consent from the families of the diseased or what.
I think this just shows how the body can be used to spread different messages and if its ethical or not.
ANYWAY, SORRY FOR THE LONG RAMBLING
Just wanted to get these thoughts out of my mind
And just to clarify: I'm not in favor of photos of corpses being used without the consent of the person of the family. I'm very happy that, despite how slow the law is, there is the ability to choose for those who have passed or are grieving, I think privacy in these situations is great. While gore photos might have had a bigger role in the past, I don't they're a must nowadays, though, exceptions always exist and things will keep changing.
Even if people dont care if their corpses get taken photos or not, the mere ability to have a say is a good thing.
One last thing, I'll recommend some videos if you are into the topic (for fun):
Ask a Mortician's channel is great in general! I love her death positive philosophy. Some videos of her channel I recommend are
A brief history of death in art
Why are black and white funeral homes still separate?
Why JFKs Casket stayed close
And Trey the Explainer's "The Great Kennewick Man Debate" (his channel is great too!)
Cheers!