Issue #29. Fix mac image upload crash bug