Dryers get plugged in and then sit that way for years and years. There isn't any wear and tear from in and out. The plugging in and out I've done the past two days is more than it has had in 14 years.Wear end tear. I replaced two outlets recently that was just worn on the inside from plugging and unplugging over and over again. Maybe that's the problem with yours too, 14 years of wear and tear. If the electricity comes and goes, so one moment the dryer is working and then suddenly there's no elecitricity, it sounds like something could be worn or loose.
The installation also looks a little rough, like someone was in a hurry and just jammed the outlet in there.
But I'm willing to consider an electrical problem. The repair man who came out for the dryer which just died said it was the motor that was completely burnt out. Maybe something on my side burnt out the dryer?