Removed some redundant code, added error listener, added Bitmap.Config option to save memory