NEW: new script for image inversion
OPT: improved parser