Image saving refactor 2