bug fixes
Added state transitions to imagestimulus

and some other minor changes