bug fix for NPE when saving Bitmap reported in issue #83