This should help:
Comparing a displayed image to a reference image
If {picture} then {do this} - #2 by admin