Ouch, what a mess. No ground wire, un-jacketed wires, wires running into a metal box holes without protection, not enough slack in the junction box. I'm guessing that is copper wire, but there is a small possibility it is aluminum which if so you need extra care with, which wouldn't have been done in the day.
Best it to pull new romex through that FMC (it looks like there is sufficient space to do this, but pictures can be deceiving) , all the way from where the wires start to where they go. The junction boxes should be removed completely.
If you cannot do the above, the first box must be moved down. Both because it needs to attach to the FMC (with the proper connector) so the wire is protected and also to provide enough slack. When the house was built you probably were allowed to use the FMC as your ground, but that isn't current code - I'm not sure if you can legally say it was a minor change and thus the old code applies, but even if you can you really should put in a proper ground wire.