Such pictures do not ordinarily show stars because the stars are not bright enough in comparison to the nearby Sun and the things it shines on.
Virtually all of the astronaut photos are of objects brightly illuminated by the Sun. To capture them on film without overexposing the image, you need a relatively short exposure, which does not provide enough time for the film to capture images of stars.
If there is no other strong light source in the picture, however, a photo can show stars.