If you put 5V on pin4 of the midi_in, does pin 6 of the opto go to 0V?
If you put 0V on pin4 of the midi_in, does pin 6 of the opto go to 3.3V?
If yes, then at least your opto does work.
In that last photo, I still see a 10K from pin 5 to gnd. Pin5 should go directly to GND. pin7 goes , via 10K, to ground, or leave that 10k out.
Does that 470R go to pin 6?
You didn't swap pin2 and pin 4?