Your first picture shows a NEMA 14-30 plug for the clothes dryer.
Your second picture shows a NEMA 10-50 socket.
If you as
you should have 240 V to operate the heating facilities of the dryer BUT you may not have a Neutral connection, which MAY be required to operate the 120 V control (motor [?]) activities of this dryer. If you DO have these facilities, the "Grounding" of your dryer will be via the Neutral.
For information on this, see
https://en.wikipedia.org/wiki/NEMA_connector : -
"As commonly used, 10-30 and 10-50 plugs have the frame of the appliance grounded through the neutral blade. This was a legal grounding method under the National Electrical Code for electric ranges and electric clothes dryers from the 1947 to the 1996 edition. Since North American dryers and ranges have certain parts (timers, lights, fans, etc.) that run on 120 V, this means that the wire used for grounding is also carrying current. Although this is contrary to modern grounding practice, such installations remain common in the United States and are relatively safe, because the larger conductors used are less likely to be broken than the smaller conductors used in ordinary appliance cords, and the current carried on the neutral conductor is small."
Having considered the above, you may wish to engage the services of a competent electrical contractor to change the socket concerned to a NEMA 14-30, which will supply 240 V (plus 120 V, via the Neutral), together with an actual "Ground" connection to the frame of the dryer.
Note that the plug which you have requires a maximum of "only" 30 A while the socket which you have should be capable of supplying 50 A. Hence, there should be no electrical supply problem in replacing this socket - apart from the need to connect to the Neutral.