Fixed on_resume issue. Also check for overwriting image before saving