is it a photodiode or a phototransistor?
There are a few ways you can do this:


Connect a voltmeter across the leads and shine a bright light or a laser pointer on it. If the voltmeter reads a voltage (not just noise) then it is probably a photodiode.
Connect a diode tester across the leads. While this isn't ideal as they are in-circuit, it may still work. If your diode tester doesn't read anything, swap the leads around. If you still don't see a reading, then it's probably a phototransistor.
If the board has some sort of amplifier (an op-amp, most likely) connected close to these devices, they're probably photodiodes. Otherwise they could be phototransistors, which are just switches and wouldn't need amplification.
Do the PCB designators show a "D" or a "Q"? "D" is for diode, "Q" is for transistor


In order to get a more accurate reading (particularly with the diode test) it would be best to desolder one leg of the device (to take it out of the circuit) before measuring. However, it looks like there is some sort of gunk holding it to the board so you may need to remove that first.

Obviously a better view of the (entire) board and part numbers would be very helpful in this case.