DO NOT connect the ground wire to the grounded (neutral) conductor, as this could lead to current flowing through the body of the dryer (and potentially through you).
The installation guide for the dryer will have wiring instructions for both 3, and 4 wire configurations. Check the manufacturers documentation for proper wiring, but I would say the first image is likely correct.
Instructions from random Maytag Installation Instructions (PDF)
3 Wire Cord
4 Wire Cord
Update:
After doing some research, and looking at dryer wiring diagrams. It turns out that the green/yellow wire is not a ground wire, it is a neutral to case bonding wire. When this wire is not in use (in a 4-wire installation for example), it is simply connected to the neutral terminal and is unused.
You're asking how to ground it properly.
The instructions are telling you to do something which is not proper. NEMA 10 receptacles don't have ground. So they are telling you to misuse the neutral wire as ground.
In any other application, this would be called "bootlegging ground" and you'd fail a home inspection for it. However, appliance manufacturers have lobbied the NFPA to allow this for dryers and ranges so they don't lose appliance sales. The rationalization - which doesn't make much sense to me - is that dryer receptacles are rarely unplugged, so they're not likely to have a failure.
The failure mode is that if there's any problem with your neutral wire anywhere in your house wiring or dryer cord, the 120V loads will stop working, and the current path through them will connect neutral - and thus the dryer chassis - to 120V. You're dead if you touch the dryer chassis and any other ground. Such as the washing machine right next to it.
Option 1: Ground it, properly.
Don't mess with that heavy 10/2 cable; retrofit a ground wire. This is legal and encouraged. The builder supply sells #8 ground wire by the foot, and it's no bigger than telephone wire. #10 would suffice if you can get that cheap.
Use any feasible route to get back to the service panel that powers the dryer circuit. You do not need to run the ground wire with the conductors, because the ground wire does not carry current except during a fault condition. You don't even need to go back to the panel if you can reach something else that has a #10 ground path back to the panel (water heater, A/C, range). Circuits can share ground as long as they come from the same panel.
Then, install a NEMA 14-30 receptacle. If the neutral is bare, that's allowed because the cable is grandfathered, but wrap it (and the ground, if necessary) with tape so they don't short out. Neutral is not ground, and will be a fraction of a volt higher than ground when the machine is at full load, and you don't want it taking ground as an alternate path.
Option 2. Don't ground it; properly.
Here you leave the wiring, but render it safe. You change the 2-pole breaker in the service panel to GFCI. When the person starts to be shocked, the GFCI trips and saves them.
You must then change the receptacle to NEMA 14, connect nothing to the ground pin, and add a label "GFCI protected / No Equipment Ground". Then you need to change the dryer cord to NEMA 14, following all dryer instructions on how to remove the bootleg neutral-ground bonding on the dryer.
At this point the dryer chassis will "float". A neutral failure will not energize the dryer. A ground fault inside the dryer will electrify its chassis, however that should trip the GFCI before harming a human.
This method only works as a retrofit. It can't be used on new installations; those must be grounded NEMA 14 from the outset.
Best Answer
That should work fine. Most dryers have a tiny 16-14 AWG bonding wire.
The only problem I can think of, is not making a good neutral connection to the dryer. However, since it looks like you have crimp terminals on the ends of the supply wires, you shouldn't have this problem.