My understanding is that D was the long range variant with maximum fuel tankage and high speed canopy based on the PR.IV, while the G was similar but armed. I think the G was only applied to the PR.VII.
PR suffixes A - D was applied across Mk.I, II, III, & V variants
These PR mods were usually retro fitted to normal early fighter variants, and the Mark numbers and suffix letters can get confusing.
I think W denoted the camera type fitted, sure there was an 'X' aswel.
Edit,
All of the following information is taken from E.Morgan/ E.Shacklady Spitfire - The History bible, Key publishing.
Type A, Spitfire PR.IA & PR.III, normal fighter fuel load, 1 F.24 camera in each wing, 1 spotting camera behind pilot.
Type B, Spitfire PR.IB & PR.III, Short-Range, additional 29 Gal fuel tank, cameras as Type A with 8" camears in underwing blisters.
Type C, Spitfire PR.IC & PR.III, Long-Range, additional 30 Gal fuel tank in Fuse, 30 Gal fuel tank in port wing blister, 1 fuse camera, 2 x F.24-8" cameras in stbd wing blister.
Type D, Spitfire PR.III, PR.IV, & V, Super Long-Range, additional 66 1/5 Gal fuel tanks in each wing leading edge, 30 Gal in fuse, additional oil, could be fitted with W & X, or Y camera installations. Some as PR.IV(T) fitted with Aboukir tropical filter, K Type dinghy, and drinking water supply.
Type F, Spitfire PR.VI, Long-Range, 20 Gal fuel fuse tank and 30 Gal tank in each underwing blister,1 or 2 x F.8-20", or 2 x F.24-20" cameras.
Type E, as above but with provision for Oblique F24 camera.
Type G, Spitfire PR.VII, PR.XIII (Merlin 32), Armed with standard A fighter wing (8 x 303s) and with fighter bullet proof windscreen, 1 F24-5", 1 F24-14" vertical cameras, 1 F24 Oblique could be added. Teardrop bulges in each side of hood.
Apart from the G, all the variants were unarmed and featured the smoth high speed windscreen.
‘W’, ‘X’, & ‘Y’ refers to specific camera installations that could be fitted to both PR.IV and PR.XI Spitfires, Types W (2 x Vertical F.8- 20” cameras) & X (2 x Vertical F.24-14”, & 1 x Oblique F.24-14”) were interchangeable and both featured two vertical cameras which were slightly angled off the vertical to one side from each other with their own apertures, the Y type (1 x Vertical F.52-36”) was fixed in to some aircraft. All installations had provision for camera heating.
Examples of serials,
N3071, PR.I Type A, PR.I Type B, PR.I Type C, PR.III
L1004 PR.XIII
N3187 PR.III
X4492 PR.VI
X4786 PR.VII
BP932 PR.IV T
BR419 PR.IV
BS499 PR.XI
It should be stressed that this is a very short overview, and that the book should be looked up for far more detail.