Gallery2: Ensure background cleanup complete on back key

Block back key event till the image gets displayed
when user presses edit option/icon.
This'll allow the background process to cleanup memory.
Added null check and bitmap recycle to avoid crash.

Change-Id: I54b3ae429e193f28ba66e16e10bf0cf511af39d6