Moving code not specific to script file into moving_images milibrary module.