fixed a native crash in image viewer caused by a bug in BitmapRegionDecoder
fixed image file not saved correctly.
better HTTP client implementation for API.