diff --git a/apps/gallery/ajax/galleryOp.php b/apps/gallery/ajax/galleryOp.php
index b49e52f0bd2d49c560874e87b37492eab558aea2..7cbe3e46e2175dc4d5ff1b2bafca9f442df183bb 100644
--- a/apps/gallery/ajax/galleryOp.php
+++ b/apps/gallery/ajax/galleryOp.php
@@ -42,7 +42,7 @@ function handleRemove($name) {
 
 function handleGetThumbnails($albumname) {
   OCP\Response::enableCaching(3600 * 24); // 24 hour
-  $view = OCP\App::getStorage('gallery');
+  $view = OCP\Files::getStorage('gallery');
   $thumbnail = $view->fopen(urldecode($albumname).'.png', 'r');
   header('Content-Type: '.OC_Image::getMimeTypeForFile($thumbnail));
   OCP\Response::sendFile($thumbnail);
diff --git a/apps/gallery/ajax/sharing.php b/apps/gallery/ajax/sharing.php
index 304757b9e9141712eaf8b87b365d174629665fea..7134d19e78a903f9ff78fd37551f11bee5380936 100644
--- a/apps/gallery/ajax/sharing.php
+++ b/apps/gallery/ajax/sharing.php
@@ -80,7 +80,7 @@ function handleGetThumbnail($token, $imgpath) {
 function handleGetAlbumThumbnail($token, $albumname)
 {
   $owner = OC_Gallery_Sharing::getTokenOwner($token);
-  $view = OCP\App::getStorage('gallery');
+  $view = OCP\Files::getStorage('gallery');
   $file = $view->fopen($albumname.'.png', 'r');
   $image = new OC_Image($file);
   if ($image->valid()) {
@@ -94,7 +94,7 @@ function handleGetAlbumThumbnail($token, $albumname)
 
 function handleGetPhoto($token, $photo) {
   $owner = OC_Gallery_Sharing::getTokenOwner($token);
-  $view = OCP\App::getStorage('files');
+  $view = OCP\Files::getStorage('files');
   $file = $view->fopen(urldecode($photo), 'r');
   header('Content-Type: '.OC_Image::getMimeTypeForFile($file));
   OCP\Response::sendFile($file);
diff --git a/apps/gallery/lib/album.php b/apps/gallery/lib/album.php
index 8ac27b1a70dca912560e16d0b5486a4470ab3348..39d6d3aded1b0c35f8b26ba658acc6e4d6d465a0 100644
--- a/apps/gallery/lib/album.php
+++ b/apps/gallery/lib/album.php
@@ -90,7 +90,7 @@ class OC_Gallery_Album {
 	}
 
 	public static function changeThumbnailPath($oldname, $newname) {
-		$view = OCP\App::getStorage('gallery');
+		$view = OCP\Files::getStorage('gallery');
 		$view->rename($oldname.'.png', $newname.'.png');
 	}
 
diff --git a/apps/gallery/lib/photo.php b/apps/gallery/lib/photo.php
index b4b37236b0e71fcec00dcbfeaa71617edf90f47c..f9527cb5fdbe8301ad70265b25c40e2e01a5ca58 100644
--- a/apps/gallery/lib/photo.php
+++ b/apps/gallery/lib/photo.php
@@ -68,7 +68,7 @@ class OC_Gallery_Photo {
 
 	public static function getThumbnail($image_name, $owner = null) {
 		if (!$owner) $owner = OCP\USER::getUser();
-		$view = OCP\App::getStorage('gallery');
+		$view = OCP\Files::getStorage('gallery');
 		$save_dir = dirname($image_name);
 		if (!$view->is_dir($save_dir)) {
 			$view->mkdir($save_dir);
diff --git a/apps/gallery/lib/scanner.php b/apps/gallery/lib/scanner.php
index e11ba1da454dc49ccefac1166e49a765c60c5c79..233fa20bca7aea21fb5d7ab3f08e46313aee6ee4 100644
--- a/apps/gallery/lib/scanner.php
+++ b/apps/gallery/lib/scanner.php
@@ -81,7 +81,7 @@ class OC_Gallery_Scanner {
 				$image->destroy();
 			}
 		}
-		$view = OCP\App::getStorage('gallery');
+		$view = OCP\Files::getStorage('gallery');
 		imagepng($thumbnail, $view->getLocalFile($albumName.'.png'));
 		imagedestroy($thumbnail);
 	}