Added image rotation logic. Moved image decoding off the UI thread.