diff --git a/core/ajax/publicpreview.php b/apps/files_sharing/ajax/publicpreview.php
similarity index 97%
rename from core/ajax/publicpreview.php
rename to apps/files_sharing/ajax/publicpreview.php
index 83194d5349c2e768ce5f327c8df5e1feaca81209..41a1c178a48f64243343c41842cdcadfa64c82e7 100644
--- a/core/ajax/publicpreview.php
+++ b/apps/files_sharing/ajax/publicpreview.php
@@ -81,6 +81,5 @@ try{
 	$preview->show();
 } catch (\Exception $e) {
 	\OC_Response::setStatus(500);
-	\OC_Log::write('core', $e->getmessage(), \OC_Log::ERROR);
-	exit;
+	\OC_Log::write('core', $e->getmessage(), \OC_Log::DEBUG);
 }
\ No newline at end of file
diff --git a/apps/files_sharing/appinfo/routes.php b/apps/files_sharing/appinfo/routes.php
new file mode 100644
index 0000000000000000000000000000000000000000..02815b5eb42919936c19278333517faf562c1cb1
--- /dev/null
+++ b/apps/files_sharing/appinfo/routes.php
@@ -0,0 +1,5 @@
+<?php
+$this->create('core_ajax_public_preview', '/publicpreview.png')->action(
+function() {
+	require_once __DIR__ . '/../ajax/publicpreview.php';
+});
\ No newline at end of file
diff --git a/core/ajax/trashbinpreview.php b/apps/files_trashbin/ajax/preview.php
similarity index 94%
rename from core/ajax/trashbinpreview.php
rename to apps/files_trashbin/ajax/preview.php
index a916dcf229fcc85cd314f337a353f2147a910a90..a0846b051c7217ff270ae88ad9a9258330a1be88 100644
--- a/core/ajax/trashbinpreview.php
+++ b/apps/files_trashbin/ajax/preview.php
@@ -38,6 +38,5 @@ try{
 	$preview->showPreview();
 }catch(\Exception $e) {
 	\OC_Response::setStatus(500);
-	\OC_Log::write('core', $e->getmessage(), \OC_Log::ERROR);
-	exit;
+	\OC_Log::write('core', $e->getmessage(), \OC_Log::DEBUG);
 }
\ No newline at end of file
diff --git a/apps/files_trashbin/appinfo/routes.php b/apps/files_trashbin/appinfo/routes.php
new file mode 100644
index 0000000000000000000000000000000000000000..b1c3f02741edde288e37139dad7a59d9dba63969
--- /dev/null
+++ b/apps/files_trashbin/appinfo/routes.php
@@ -0,0 +1,5 @@
+<?php
+$this->create('core_ajax_trashbin_preview', '/preview.png')->action(
+function() {
+	require_once __DIR__ . '/../ajax/preview.php';
+});
\ No newline at end of file
diff --git a/core/routes.php b/core/routes.php
index ce35be1d583cac7fc202825cc5329e022cc2d8d1..f0f8ce571e22834d915081bef33aca5b41a8a58b 100644
--- a/core/routes.php
+++ b/core/routes.php
@@ -44,10 +44,6 @@ $this->create('core_ajax_routes', '/core/routes.json')
 	->action('OC_Router', 'JSRoutes');
 $this->create('core_ajax_preview', '/core/preview.png')
 	->actionInclude('core/ajax/preview.php');
-$this->create('core_ajax_trashbin_preview', '/core/trashbinpreview.png')
-	->actionInclude('core/ajax/trashbinpreview.php');
-$this->create('core_ajax_public_preview', '/core/publicpreview.png')
-	->actionInclude('core/ajax/publicpreview.php');
 OC::$CLASSPATH['OC_Core_LostPassword_Controller'] = 'core/lostpassword/controller.php';
 $this->create('core_lostpassword_index', '/lostpassword/')
 	->get()