That photo is a composite (links to here).
Not only was the picture a combination of several Hasselblad shots, but the golf club, ball, the S-Band legs and some shadows were drawn in. The publishers of the book created the image because the existing real video images were too grainy to present in a book’s picture section.
The golf shot was captured on video, but that was low-resolution and didn't really capture the ball. Even the club was barely visible.
135:08:17 Shepard: (Facing the TV) Houston, while you're looking that up, you might recognize what I have in my hand is the handle for the contingency sample return; it just so happens to have a genuine six iron on the bottom of it. In my left hand, I have a little white pellet that's familiar to millions of Americans. I'll drop it down. Unfortunately, the suit is so stiff, I can't do this with two hands, but I'm going to try a little sand-trap shot here. (Pause)
No photos were taken of the golf shot, the cameras were already stowed by then. The golf shot came at the very end of EVA-2.
[Readers should note that, while the golf-shot picture in Al's book Moonshot bears some resemblance to the TV images, it is actually a composite made up of pieces of various Hasselblad images. The only actual record of the golf shot is the TV coverage. Al and Ed had already put their Hasselblads into the ETB at about 135:06:06.]
[Not long after I bought a copy of Moonshot, Andrew Chaikin and I had a long telephone conversation about the composite and worked out - at least in general terms - how it was put together. Journal Contributor David Harland tells us that the 1994 hardback UK edition published by Virgin Books contains the composite, while Brian Lawrence tells us that the 1995 edition does not.]
[In the composite, the LM and LM shadow come from a left/right reversal of AS14-66 9276. Note the LRRR which is sitting in the footpad of the ladder strut. In reality, the LR-Cubed was deployed at the ALSEP site during the first EVA. Both of the astronaut images in the composite come from a pan Al took at the beginning of EVA-1 shortly before 114:53:34. The image of "Al" is actually a left/right reversal of Ed's image from AS14-66- 9240. In the real photograph, Ed is doing a TV pan. In the composite, the TV camera has been removed and the golf club has been added. The image of "Ed" in the composite is taken from another frame in Al's earlier pan, AS14-66- 9241. And, once again, the TV had been removed from a left-right reversal of the original images. Similarly, the image of the U.S. flag has been taken from AS14-66- 9232- or one of the other tourist pictures Al and Ed took during the flag deployment. I have not yet identified the precise images from which the MET and the S-Band were taken; but, the MET image is very similar to the one in AS14-67- 9361, which Al took at the ALSEP site at the end of the ALSEP deployment. Finally, the ball and the shadows of the S-Band legs - like the golf club - appear to have been drawn in.]
Here is a better photo, this one shows one of the golf balls, along with a javelin (taken from the LEM):

(The blue rectangle contains the golf ball, the red rectangle contains the javelin)