add option to get original photo and accept user-defined code executing after the code-generating process