diff --git a/apps/contacts/thumbnail.php b/apps/contacts/thumbnail.php
index d7043b75f04ca45d3c8627bdd0f13d007075faa6..9c68e0789b4f9cae69544820ce3b1c70a6af5054 100644
--- a/apps/contacts/thumbnail.php
+++ b/apps/contacts/thumbnail.php
@@ -30,10 +30,8 @@ function getStandardImage(){
 	$date = new DateTime('now');
 	$date->add(new DateInterval('P10D'));
 	header('Expires: '.$date->format(DateTime::RFC2822));
-	header('Cache-Control: cache');
-	header('Pragma: cache');
-	header("HTTP/1.1 307 Temporary Redirect");
-	header('Location: '.OC_Helper::imagePath('contacts', 'person.png'));
+	OC_Response::enableCaching();
+	OC_Response::redirect(OC_Helper::imagePath('contacts', 'person.png'));
 }
 
 if(!function_exists('imagecreatefromjpeg')) {
diff --git a/lib/response.php b/lib/response.php
index c254ddd10e726fcc61da7729d74e29757958dcfd..5f095a0affdddf1f456fd88a112a106045f72780 100644
--- a/lib/response.php
+++ b/lib/response.php
@@ -7,7 +7,9 @@
  */
 
 class OC_Response {
+	const STATUS_FOUND = 304;
 	const STATUS_NOT_MODIFIED = 304;
+	const STATUS_TEMPORARY_REDIRECT = 307;
 
 	static public function enableCaching() {
 		header('Cache-Control: cache');
@@ -15,12 +17,29 @@ class OC_Response {
 	}
 
 	static public function setStatus($status) {
+		$protocol = $_SERVER['SERVER_PROTOCOL'];
 		switch($status) {
 			case self::STATUS_NOT_MODIFIED:
 				$status = $status . ' Not Modified';
 				break;
+			case self::STATUS_TEMPORARY_REDIRECT:
+				if ($protocol == 'HTTP/1.1') {
+					$status = $status . ' Temporary Redirect';
+					break;
+				} else {
+					$status = self::STATUS_FOUND;
+					// fallthrough
+				}
+			case self::STATUS_FOUND;
+				$status = $status . ' Found';
+				break;
 		}
-		header($_SERVER["SERVER_PROTOCOL"].' '.$status);
+		header($protocol.' '.$status);
+	}
+
+	static public function redirect($location) {
+		self::setStatus(self::STATUS_TEMPORARY_REDIRECT);
+		header('Location: '.$location);
 	}
 
 	static public function setETagHeader($etag) {