Hi Tim.
Welcome to the SBO Forum.
Thank you for the image.
What I see is dampness on the engine head. It can be oil or diesel fuel. I suspect the latter. The return line hose with the hose clamp also looks damp. I would suspect that is the source of the diesel fuel that is found on the head at the base of the injector. I would replace that length of hose. New clamps, and clean/wipe down the engine head surface so you can see if there are any more leaks.
Now for the bubbles. The injector at the base is inserted into the head at the top of the cylinder. Fuel comes out of your High Pressure Pump through the steel fuel line at the top. It is forced into the injector which meters the fuel into the cylinder. At the same time the fuel is injected, the piston in the engine is pressing up in the cylinder. The pressure rises until the diesel air mix combusts driving the piston down.
If you have bubbles from this process they would be under extreme high pressure. You may have some escaping partially combusted exhaust from a failed washer between the injector and the head. A little tightening will not resolve that nor will it address the behavior your engine is exhibiting. I would address the injectors when you do an engine service. I would not wait too long. These issues never resolve themselves.
The description of your engine running, racing, stalling then being resolved for a short time by bleeding the engine sounds like "FUEL STARVATION" . Start at the tank and follow the fuel lines to the engine. Make sure the tank is clean and the pick up tube is clean and clear. At each connection remove/clean/ replace or reconnect the hose. Clean the connections on the fuel filter. Install a clean filter. Check the pump that the connections and any filter is clean. Connect and assure that all connections are firmly tight / NOT strangling tear through the hose tight.
Bleed the system and then see if that resolves the issue.
Read about and inspect the hidden filter connection check valve that
@Stu Jackson has posted here on SBO.
Clean and adequate fuel flow is what your engine wants. If this is limited or stopped the engine reacts by racing RPM's, Coughing, then stalling. It will not restart till you feed it what it wants.
Good luck.