Gas fireplace flame won't stay on; both flame and pilot go out
Standard gas log sets are fairly simple. If the gas fireplace shuts off after a few minutes, it's pretty much always going to be a pilot head issue, or a valve issue. Take note that it’s the pilot head, not the thermocouple. The whole assembly is usually replaced, and they usually come at the same price. New models usually come with improved designs.

It is recommended to replace the whole pilot head instead of just the thermocouple. If you're still having issues that the gas fireplace will not stay lit, then the valve needs to be replaced. There are just no other moving parts that can go wrong on this.

One thing you can try gas fireplace shuts off after a few minutes: there's a small screw on your valve that regulates the size of your pilot flame. You can turn that screw to make it bigger. This can be done in case the pilot flame is too small to do its job. Be careful though, sometimes the screw has a spring behind it and will shoot out and you'll have a difficult time finding it. If you mess with the screw, slowly relieve pressure and make sure it's still threaded into the valve.

If this doesn’t resolve the problem, you may want to consider replacing the valve. Here’s a useful article regarding DIY valve replacement. Hope this helps.