In a homicide case, the prosecution must prove that the victim is dead and that the defendant is responsible for that death. Photos or sketches or diagrams are often introduced. They are generally relevant to show the person is dead, and sometimes to show how they died or did not die.
Unless there is some reason to exclude, evidence that is relevant to an issue in the case is generally admissible. Evidence is relevant if it has some tendency to prove the defendant committed the charged crime.
Even relevant evidence can be excluded, however, if it is unduly prejudicial, repetitive, confusing, or will take a long time. Often, crime scene photos or dead body photos will be excluded as unduly prejudicial. In other words, any value the evidence may have of proving a fact is substantially outweighed by prejudice to the defendant.
If a crime scene photo is especially gruesome, it may be excluded. The concern is that the jury would be so upset by the photo that they would judge the defendant guilty based on emotion rather than evidence. It is up to the judge to determine whether a photo will be admitted in a particular case.