Internal refactor apis for enchancement

-Refactor onPrepare
-Cancel message
-receive two arguments on uniqueFileName on imageHandle

Signed-off-by: sguan <sguan@actuate.com>