How to properly utilize RPI 1391
Check your LED polarity; anode is meant to be the positive and cathode the negative electrode. You seem to have connected them the other way around. Also, don't forget the current-limiting resistor for the LED.

Also, this opto puts out up to 5V on its output. Your raspi will not like that.