diff --git a/youtube.inc b/youtube.inc
index 38e0e15..73e3a37 100644
--- a/youtube.inc
+++ b/youtube.inc
@@ -83,60 +83,65 @@ function youtube_get_dimensions($size = NULL, $width = NULL, $height = NULL) {
 /**
  * Retreve youtube thumbnail image via YouTube API.
  *
- * TODO add error messaging if something goes wrong, and return FALSE.
- *
  * @param $id
  *   The video_id of the particular YouTube video.
  * @param $force_small
  *   When TRUE, this function should return the standard size image regardless
  *   of what the youtube_thumb_hires variable is set to. This is used should
  *   the high resolution image be found to not exist for a particular video.
+ *
+ * Returns either the Drupal $file object of saved image, or FALSE if image save failed
  */
 function youtube_get_remote_image($id = NULL, $force_small = FALSE) {
-  // This variable is TRUE when higher resolution thumnbails should be saved.
-  // The only thumbnail resolution higher than the standard 480 is
-  // 'maxresdefault'. This resolution image is not guaranteed to exist. After
-  // saving the file, we check to ensure that it does.
+  // Maxresdefault, the highest available resolution thumbnail, is not guaranteed
+  // to exist, but we'll check for it first if this setting returns true
   $youtube_thumb_hires = variable_get('youtube_thumb_hires', FALSE);
+  $get_hires = ($youtube_thumb_hires && !$force_small);
 
-  if ($youtube_thumb_hires && !$force_small) {
+  if ($get_hires) {
     $src = youtube_build_remote_image_path($id, 'maxresdefault');
   }
   else {
     $src = youtube_build_remote_image_path($id);
   }
 
-  // Make the actual request to download the file.
-  $image_result = drupal_http_request($src);
+  // Download the file and save it as managed Drupal file.
+  $image = drupal_http_request($src);
+  if ($image->code != 200) {
+    // Silently retry for small image if hires did not exist. On fail pass false up.
+    if ($get_hires) return youtube_get_remote_image($id, TRUE);
+    watchdog('youtube', 'HTTP request for video ID %id failed (error code: %err).',
+      array('%id', $id, '%err', $image->code),
+      WATCHDOG_ERROR);
+    return FALSE;
+  }
 
-  // Assure the youtube thumbnail directory exists.
-  $files = variable_get('file_public_path', conf_path() . '/files');
-  $youtube_dir = variable_get('youtube_thumb_dir', 'youtube');
-  $youtube_path = $files . '/' . $youtube_dir;
-  if (!file_prepare_directory($youtube_path, FILE_CREATE_DIRECTORY) && !mkdir($youtube_path, 0775, TRUE)) {
-    watchdog('youtube', 'Failed to create YouTube thumbnail directory: %dir', array('%dir' => $youtube_path), WATCHDOG_ERROR);
+  // Set the path to thumbnails, and make sure it's usable.
+  $youtube_path = variable_get('youtube_thumb_dir', 'youtube');
+  $youtube_dir = file_default_scheme() . '://' . $youtube_path;
+  if (!file_prepare_directory($youtube_dir, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS)) {
+    watchdog('youtube', 'Failed to create YouTube thumbnail directory: %dir', array('%dir' => $youtube_dir), WATCHDOG_ERROR);
+    return FALSE;
   }
 
-  // Save the file.
-  $dest = $files . '/' . $youtube_dir . '/' . $id . '.jpg';
-  file_put_contents($dest, $image_result->data);
-
-  // If the high resolution image was saved but didn't actually exist, a very
-  // small placeholder image from YouTube will have been saved. By checking the
-  // dimensions of this image, we can determine if we saved the placeholder.
-  if ($youtube_thumb_hires && !$force_small) {
-    $image_path = $files . '/' . $youtube_dir . '/' . $id . '.jpg';
-    if (file_exists($image_path)) {
-      $image_size = getimagesize($image_path);
+  if (!$file) {
+    watchdog('youtube',
+      'Unable to save youtube thumbnail to filesystem for video %id',
+      array('%id' => $id),
+      WATCHDOG_ERROR);
+
+  // If we intended to get the hires version but actually received the small placeholder we can check the size and retry.
+  if ($get_hires) {
+      $image_size = getimagesizefromstring($image->data);
       if (empty($image_size[0]) || $image_size[0] < 480) {
         // We saved the placeholder. Re-run this function with $force_small
         // set to TRUE. This will give us the standard, guaranteed, thumbnail.
-        youtube_get_remote_image($id, TRUE);
+        return youtube_get_remote_image($id, TRUE);
       }
     }
   }
 
-  return TRUE;
+  return $file;
 }
 
 /**
@@ -149,18 +154,38 @@ function youtube_thumb_delete_all($form, &$form_state) {
   $youtube_dir = variable_get('youtube_thumb_dir', 'youtube');
   $youtube_path = $files . '/' . $youtube_dir;
 
-  $imagestyleflush = t('Derivatives generated with image styles were not
-    deleted. <a href="@imagestyleflush">Image style flush</a> may help with that.',
-    array('@imagestyleflush' => 'https://www.drupal.org/project/imagestyleflush'));
+  if (!file_prepare_directory($youtube_path)) {
+    return drupal_set_message(t('Youtube thumb directory does not exist!  No files deleted.'));
+  }
 
-  if (file_prepare_directory($youtube_path) && file_unmanaged_delete_recursive($youtube_path)) {
-    drupal_set_message(t('All YouTube Field thumbnail image files have been
-      deleted and will be redownloaded upon the next page load.'));
-    drupal_set_message($imagestyleflush);
+  $files = file_scan_directory($youtube_path, '/^.*\.(jpg|png)$/');
+
+  $legacy_files = false;
+  foreach ($files as $raw_file) {
+    //check if file is being managed by Drupal
+    $uri = $youtube_dir . '/' . $raw_file->filename;
+    $managed_file = db_select('file_managed', 'fm')
+      ->fields('fm')
+      ->condition('uri', '%'. $uri, 'LIKE')
+      ->execute()
+      ->fetchAssoc();
+    if (!$managed_file) {
+      //old files exist before module used managed files, notify user
+      $legacy_files = file_unmanaged_delete($raw_file->uri);
+    } else {
+      $file = file_load($managed_file['fid']);
+      //file_delete invokes hooks to refresh associated image files
+      file_delete($file);
+    }
   }
-  else {
-    drupal_set_message(t('There were no thumbnails to delete.'), 'warning');
-    drupal_set_message($imagestyleflush, 'warning');
+
+  if ($legacy_files) {
+    drupal_set_message(t('Some un-managed files from an older version of the ' .
+      'youtube module were deleted, so their associated' .
+      ' image styles were not deleted. <a href="@imagestyleflush">Image style flush</a>' .
+      ' may help with that.  Alternatively, `drush image-flush` will reset any image ' .
+      ' styles you may be using for youtube thumbnails. New thumbnails will not have this issue.',
+      array('@imagestyleflush' => 'https://www.drupal.org/project/imagestyleflush')));
   }
 }
 
diff --git a/youtube.theme.inc b/youtube.theme.inc
index c3e50f7..4ea6379 100644
--- a/youtube.theme.inc
+++ b/youtube.theme.inc
@@ -111,10 +111,6 @@ function theme_youtube_thumbnail($variables) {
   $id = $variables['video_id'];
   $style = $variables['image_style'];
 
-  // Get YouTube settings - TODO is this needed?
-  $size = variable_get('youtube_size', '420x315');
-  $dimensions = youtube_get_dimensions($size);
-
   $files = variable_get('file_public_path', conf_path() . '/files');
   $youtube = variable_get('youtube_thumb_dir', 'youtube');
   $dest = $files . '/' . $youtube . '/' . $id . '.jpg';
