avatarmanipuation: fix return button infinite loop

In the case the a new photo was taken, the return (undo) button
would get stuck in an infinite loop when trying to return from
edit state to photo state and then from photo state to current state.
In this case it would keep going between the edit and photo state
instead of going back to the current state.

Change-Id: I7550b3fa0bdcdb3d5d373911fae56f46c09eaef8
Tuleap: #917
1 file changed