As already noted by some others, moving the dryer to the wall where the vent ends is a great idea. The location for a gas dryer needs three things:
Vent - Absolutely perfect. While you're at it, since it will be a short distance, splurge on some rigid metal ductwork. For a short length it doesn't cost much, and it is much less vulnerable than the flexible stuff to (a) lint buildup and (b) punctures. Punctures are an annoyance with an electric dryer - the worst that happens is some hot, moist air in the room. But with a gas dryer they can be downright dangerous if carbon monoxide leaks into the room.
Electricity - You may or may not be able to turn that old NEMA 10-30 into a functional 120V receptacle, but right next to it is what appears to be a standard duplex GFCI receptacle.
Gas - You're in luck here too. Your water heater is in the closet.
Put the $ 300 - $ 500 toward a qualified plumber/gasfitter and you're all set. It actually shouldn't cost very much - basically splitting off the connection a short distance to provide a connection outside the closet for the dryer.
Depending on where you are, it may be way cheaper (heat pumps are quite efficient) in terms of gas/electricity bills. It may be somewhat more expensive if the gas is less than 1/4 price of the electricity per btu or kWh
It requires no ducts. It doesn't vent anything.
It requires no plumbing. A drainpipe is optional and pretty easy to arrange near the washing machine.
It is better for fabrics.
Fire safety is a great deal better.
It emits less heat (less expenses for A/C).
This is important. If you live in a rather warm place, the extra load on A/C system may in fact dominate your expenses operating the dryer. Esp. with a duct that long that radiates most of the heat in the room.
It sucks no air from the room (better comfort and even less A/C load).
No special electric arrangement needed (most of these are way less than 1kW peak)
Going back to electric and moving to the other wall is probably the easiest. Getting power on that other wall for the dryer, if not already there, will probably be much easier for you as opposed to moving the gas line.
Straight-walled pipe, running more or less the same path as that corrugated foill stuff,, would be easier to clean and have less resistance to flow. Just glue the joints up high so that it can be disassembled when necessary to run one of those vent cleaning attachments for a cordless drill.
Not being next to the washer would be inconvenient, but the simplest option would be to move your drier to the wall where it vents through.
Installing new plumbing on that wall would let you move the washer too, but would be somewhat more involved of a job.
I see what looks like an old NEMA 10-30 outlet on the left wall below the light switch. That probably was the power outlet the drier used before it was moved across the room. Probably too much to hope for, but there aren't unused plumbing connections for a washer on that wall are there?
I would just replace all that cheap flex hose with rigid duct. A clean, square install will dramatically reduce buildup and airflow resistance. I've had several homes with similar setups and they worked just fine.
Use short sheet metal screws and foil tape at the joints. Use as few bends as possible while keeping things tidy. Five bends should do to bring it up the dryer wall, across to the beam, and down to the opening in the wall.