diff --git a/src/com/android/dreams/phototable/PhotoCarousel.java b/src/com/android/dreams/phototable/PhotoCarousel.java
index 495e73c..70ba046 100644
--- a/src/com/android/dreams/phototable/PhotoCarousel.java
+++ b/src/com/android/dreams/phototable/PhotoCarousel.java
@@ -48,7 +48,6 @@
     private final PhotoSourcePlexor mPhotoSource;
     private final GestureDetector mGestureDetector;
     private final View[] mPanel;
-    private final BitmapFactory.Options mOptions;
     private final int mFlipDuration;
     private final int mDropPeriod;
     private final int mBitmapQueueLimit;
@@ -100,8 +99,6 @@
         mDropPeriod = resources.getInteger(R.integer.carousel_drop_period);
         mBitmapQueueLimit = resources.getInteger(R.integer.num_images_to_preload);
         mFlipDuration = resources.getInteger(R.integer.flip_duration);
-        mOptions = new BitmapFactory.Options();
-        mOptions.inTempStorage = new byte[32768];
         mPhotoSource = new PhotoSourcePlexor(getContext(),
                 getContext().getSharedPreferences(FlipperDreamSettings.PREFS_NAME, 0));
         mBitmapStore = new HashMap<View, Bitmap>();
@@ -130,6 +127,13 @@
     }
 
     private class PhotoLoadTask extends AsyncTask<Void, Void, Bitmap> {
+        private final BitmapFactory.Options mOptions;
+
+        public PhotoLoadTask () {
+            mOptions = new BitmapFactory.Options();
+            mOptions.inTempStorage = new byte[32768];
+        }
+
         @Override
         public Bitmap doInBackground(Void... unused) {
             Bitmap decodedPhoto;
@@ -180,8 +184,8 @@
         if (photo != null) {
             ImageView destination = getBackface();
             Bitmap old = mBitmapStore.get(destination);
-            int width = mOptions.outWidth;
-            int height = mOptions.outHeight;
+            int width = photo.getWidth();
+            int height = photo.getHeight();
             int orientation = (width > height ? LANDSCAPE : PORTRAIT);
 
             destination.setImageBitmap(photo);
diff --git a/src/com/android/dreams/phototable/PhotoTable.java b/src/com/android/dreams/phototable/PhotoTable.java
index ddf2f58..50212c9 100644
--- a/src/com/android/dreams/phototable/PhotoTable.java
+++ b/src/com/android/dreams/phototable/PhotoTable.java
@@ -85,7 +85,6 @@
     private PhotoLaunchTask mPhotoLaunchTask;
     private boolean mStarted;
     private boolean mIsLandscape;
-    private BitmapFactory.Options mOptions;
     private int mLongSide;
     private int mShortSide;
     private int mWidth;
@@ -114,8 +113,6 @@
         mDropInterpolator = new DecelerateInterpolator(
                 (float) mResources.getInteger(R.integer.drop_deceleration_exponent));
         mOnTable = new LinkedList<View>();
-        mOptions = new BitmapFactory.Options();
-        mOptions.inTempStorage = new byte[32768];
         mPhotoSource = new PhotoSourcePlexor(getContext(),
                 getContext().getSharedPreferences(PhotoTableDreamSettings.PREFS_NAME, 0));
         mLauncher = new Launcher(this);
@@ -242,6 +239,13 @@
     }
 
     private class PhotoLaunchTask extends AsyncTask<Void, Void, View> {
+        private final BitmapFactory.Options mOptions;
+
+        public PhotoLaunchTask () {
+            mOptions = new BitmapFactory.Options();
+            mOptions.inTempStorage = new byte[32768];
+        }
+
         @Override
         public View doInBackground(Void... unused) {
             log("load a new photo");
@@ -252,11 +256,11 @@
             View photo = inflater.inflate(R.layout.photo, null);
             ImageView image = (ImageView) photo;
             Drawable[] layers = new Drawable[2];
-            Bitmap decodedPhoto = table.mPhotoSource.next(table.mOptions,
+            Bitmap decodedPhoto = table.mPhotoSource.next(mOptions,
                     table.mLongSide, table.mShortSide);
-            int photoWidth = table.mOptions.outWidth;
-            int photoHeight = table.mOptions.outHeight;
-            if (table.mOptions.outWidth <= 0 || table.mOptions.outHeight <= 0) {
+            int photoWidth = mOptions.outWidth;
+            int photoHeight = mOptions.outHeight;
+            if (mOptions.outWidth <= 0 || mOptions.outHeight <= 0) {
                 photo = null;
             } else {
                 decodedPhoto.setHasMipMap(true);
