Working image saving
Changes made by Ilian Nikolov (ilian.nikolov@gmail.com).