On this line the code is checking the trigger flag and the note new flag:
if etc.audio_trig or etc.midi_note_new :
Both of these flags get cleared after each frame is drawn. If you want to display the image every frame while the note is down you have to use etc.midi_notes. This is a list of the 127 MIDI notes, a 0 means the note is not playing any other value it is playing. So you could replace this:
if etc.audio_trig or etc.midi_note_new :
with this:
# loop through notes to see if any are held down
note_down = False
for note in etc.midi_notes :
if note != 0 : note_down = True
# display image if down
if note_down :