To call gen_IM_data anywhere, let it jump to the directory of itself.