Bug 1042319 - [Gallery] WIP patch of update gallery edit UI and visuals

As I suggested in comments above, resetting the UI on cancel seems like the wrong approach to me.  I suggest that you:

1) have a single state object that holds everything you need
2) Make a copy of that object when you enter an edit mode
3) Initialize the UI for the edit mode from your state object when you enter that mode.
4) If the user cancels, then restore your state from the copy you made.

So if the user cancels, I'd say all you should need to do is restore your state (editState = savedEditState) and regenerate the preview image from the restored state.