Fixed image saving
Updated api