diff --git a/docroot/sites/all/modules/contrib/ooyala/ooyala.module b/docroot/sites/all/modules/contrib/ooyala/ooyala.module
index c564a21..8615906 100755
--- a/docroot/sites/all/modules/contrib/ooyala/ooyala.module
+++ b/docroot/sites/all/modules/contrib/ooyala/ooyala.module
@@ -51,15 +51,6 @@ function ooyala_menu() {
   );
 
   // #ajax menu callbacks.
-  $items['ooyala/ahah/video-thumbnails'] = array(
-    'title' => 'Refresh Ooyala video thumbnails',
-    'page callback' => 'ooyala_refresh_video_thumbnails',
-    'access arguments' => array('upload ooyala videos'),
-    'file path' => drupal_get_path('module', 'node'),
-    'file' => 'node.pages.inc',
-    'type' => MENU_CALLBACK,
-  );
-
   if (module_exists('colorbox')) {
     $items['ooyalavideo'] = array(
       'title' => 'Video',
@@ -303,7 +294,6 @@ function ooyala_field_info() {
   );
 }
 
-// NEW Field API hook_field hoooks (replacing hook_field)
 /**
  * Implements hook_field_insert().
  */
@@ -325,8 +315,9 @@ function ooyala_field_presave($entity_type, $entity, $field, $instance, $langcod
   ooyala_field_sanitize($entity_type, $entity, $field, $instance, $langcode, $items);
 }
 
-// Generic helper function for use in update, presave and insert hooks.
-// FIXME cleanup or at least double check (especially the file handling)
+/**
+ * Generic helper function for use in update, presave and insert hooks.
+ */
 function ooyala_field_sanitize($entity_type, $entity, $field, $instance, $langcode, &$items) {
   // Attempt to retrieve video status/length data before saving the field.
   module_load_include('inc', 'ooyala', 'includes/ooyala.api');
@@ -343,7 +334,7 @@ function ooyala_field_sanitize($entity_type, $entity, $field, $instance, $langco
       $thumbnail_url = $thumbnails[$item['thumbnail_list']];
 
       $thumbnail_directory = variable_get('ooyala_thumbnail_path', '');
-      $data = file_get_contents($thumbnail_url);
+      $data = file_get_contents($thumbnail_url->url);
       $file = file_unmanaged_save_data($data, file_build_uri($thumbnail_directory .'/' .$item['value'] .'.jpg'), FILE_EXISTS_REPLACE);
 
       if (isset($file)) {
@@ -540,7 +531,7 @@ function ooyala_field_widget_form(&$form, &$form_state, $field, $instance, $lang
   $element += array(
     '#title' => (empty($instance['label']) ? '' : t($instance['label'])),
     '#type' => 'ooyala_embedcode',
-    '#default_value' => !empty($items) ? $items : array(),
+    '#default_value' => !empty($items[$delta]) ? $items[$delta] : array(),
   );
   return $element;
 }
@@ -584,12 +575,12 @@ function ooyala_embedcode_process($element, &$form_state, $form) {
 
   $element['#theme'] = 'ooyala_embedcode';
   $element['#ooyala_api_available'] = ooyala_api_available();
-  $element['#ooyala_video'] = isset($element['#value'][0]['value']) ? ooyala_api_video_load($element['#value'][0]['value']) : array();
+  $element['#ooyala_video'] = isset($element['#value']['value']) ? ooyala_api_video_load($element['#value']['value']) : array();
   $element['value'] = array(
     '#type' => 'textfield',
     '#title' => $element['#title'],
     '#description' => $element['#description'],
-    '#default_value' => isset($element['#value'][0]['value']) ? $element['#value'][0]['value'] : FALSE,
+    '#default_value' => isset($element['#value']['value']) ? $element['#value']['value'] : FALSE,
     '#required' => $element['#required'],
     '#attributes' => array('class' => array('ooyala-embed-code-input')),
   );
@@ -609,26 +600,31 @@ function ooyala_embedcode_process($element, &$form_state, $form) {
       'current' => theme('ooyala_embedcode_preview', array('embedcode' => $element['#ooyala_video']['embed_code'], 'width' => 120)),
     );
 
-
     // If the user has clicked the "Refresh thumbnails" button, then we need to
     // generate a new set of thumbnails. If not, we are previewing the node,
     // and we should use the saved thumbnail list.
-    if (!isset($form_state['ahah_submission']) && isset($element['#value'][0]['thumbnail_subset'])) {
-      foreach (explode(",", $element['#value'][0]['thumbnail_subset']) as $timecode) {
+    $is_ajax = isset($form_state['input']['_triggering_element_value']) && $form_state['input']['_triggering_element_value'] === t('Refresh thumbnails');
+    if (!$is_ajax && isset($element['#value']['thumbnail_subset'])) {
+      foreach (explode(",", $element['#value']['thumbnail_subset']) as $timecode) {
         // We need to filter out the 'current' element key.
         if (is_numeric($timecode)) {
-          $thumbnail_subset[$timecode] = theme('image', array('path' => $thumbnails[$timecode], 'alt' => t('Thumbnail at !time', array('!time' => theme('ooyala_video_length', array('length' => $timecode)))), 'title' => '', 'attributes' => array('width' => 120)));
+          $thumbnail_subset[$timecode] = theme('image', array('path' => $thumbnails[$timecode]->url, 'alt' => t('Thumbnail at !time', array('!time' => theme('ooyala_video_length', array('length' => $timecode)))), 'title' => '', 'attributes' => array('width' => 120)));
         }
       }
     }
     else {
-      // Randomly choose a thumbnail near a fifth of the video. We allow a fuzz
+      // Randomly choose 5 thumbnails at 1/5 intervals in the video. We add fuzz
       // of up to 10 thumbnail frames. As well, we need to ensure that the
       // array key is never negative and never exceeds the last thumbnail index.
-      for ($i = 0; $i < count($thumbnails); $i += ceil((count($thumbnails)) / 5)) {
-        $fuzz = min(max(0, rand($i - 5, $i + 5)), count($thumbnails) - 1);
+      $i = 0;
+      $max_thumbs = min(6, count($thumbnails));
+      while (count($thumbnail_subset) < $max_thumbs) {
+        $fuzz = min(max(1, rand($i - 5, $i + 5)), count($thumbnails) - 1);
         $key = $thumbnail_keys[$fuzz];
-        $thumbnail_subset[$key] = theme('image', array('path' => $thumbnails[$key]->url, 'alt' => t('Thumbnail at !time', array('!time' => theme('ooyala_video_length', array('length' => $key)))), 'title' => '', 'attributes' => array('width' => 120)));
+        if (!isset($thumbnail_subset[$key])) {
+          $thumbnail_subset[$key] = theme('image', array('path' => $thumbnails[$key]->url, 'alt' => t('Thumbnail at !time', array('!time' => theme('ooyala_video_length', array('length' => $key)))), 'title' => '', 'attributes' => array('width' => 120)));
+          $i += ceil((count($thumbnails)) / 5);
+        }
       }
     }
 
@@ -643,20 +639,23 @@ function ooyala_embedcode_process($element, &$form_state, $form) {
       '#type' => 'radios',
       '#title' => t('Video thumbnail'),
       '#options' => $thumbnail_subset,
-      '#default_value' => isset($element['#value'][0]['thumbnail_list']) ? $element['#value'][0]['thumbnail_list'] : 'current',
+      '#default_value' => isset($element['#value']['thumbnail_list']) ? $element['#value']['thumbnail_list'] : 'current',
       '#attributes' => array('class' => array('ooyala-upload-thumbnails')),
     );
-    
+
     $element['thumbnail_list_refresh'] = array(
       '#type' => 'submit',
       '#value' => t('Refresh thumbnails'),
       '#prefix' => '<div class="clear-block">',
       '#suffix' => '</div><div class="clear-block"></div>',
       '#ajax' => array(
-        'path' => 'ooyala/ahah/video-thumbnails/' . $element['#field_name'] . '/' . $element['#delta'],
+        'callback' => 'ooyala_refresh_video_thumbnails',
         'wrapper' => 'ooyala-video-thumbnails-' .  $element['#id'],
         'effect' => 'fade',
       ),
+      '#validate' => array(),
+      '#submit' => array(),
+      '#limit_validation_errors' => array($element['#parents']),
     );
 
     $element['thumbnail_help'] = array(
@@ -1259,58 +1258,23 @@ function ooyala_create_node($item, $content_type) {
 }
 
 /**
- * Does the very standard things that must be done in any normal callback.
- * Used by each AHAH callback in this module. This code is from the
- * ahah_example from the Examples project on drupal.org.
- *
- * Note that this calls the form builder function, so do any modifications to
- * your form in the same function that is called by drupal_get_form().
+ * Form #ajax callback for refreshing video thumbnails.
  */
-function ooyala_ahah_callback_helper() {
-  $form_state = array('storage' => NULL, 'submitted' => FALSE);
-  $form_build_id = $_POST['form_build_id'];
-  $form = form_get_cache($form_build_id, $form_state);
-
-  // Prevent submitting the form.
-  unset($form['buttons']['submit']);
-
-  $args = $form['#parameters'];
-  $form_id = array_shift($args);
-  $form_state['post'] = $form['#post'] = $_POST;
-  // Enable the submit/validate handlers to determine whether AHAH-submittted.
-  $form_state['ahah_submission'] = TRUE;
-  $form['#programmed'] = $form['#redirect'] = FALSE;
-  // Stash the original form action to avoid overwriting with
-  // drupal_rebuild_form(). For more information, see:
-  // http://drupal.org/node/591696
-  // http://jbenner.net/blog/prevent-ahah-the-right-way-from-breaking-with-validation
-  $form_state['action'] = $form['#action'];
-
-  // We don't do any validation on #ajax callbacks.
-  unset($form['#validate']);
-  foreach (element_children($form) as $child) {
-    $form[$child]['#validated'] = TRUE;
+function ooyala_refresh_video_thumbnails($form, &$form_state) {
+  $clicked_button = $form_state['triggering_element'];
+  $parents = array_slice($clicked_button['#array_parents'], 0, -1, TRUE);
+
+  // Drill down to the element.
+  $element = $form;
+  foreach ($parents as $parent) {
+    $element = $element[$parent];
   }
 
-  drupal_process_form($form_id, $form, $form_state);
-  $form = drupal_rebuild_form($form_id, $form_state, $args, $form_build_id);
-  return $form;
-}
-
-function ooyala_refresh_video_thumbnails($field, $delta) {
-  $form = ooyala_ahah_callback_helper();
-
   // We re-render both the table and the add video field so we clear the text
   // in the textfield.
-  $output = drupal_render($form[$field][$delta]['thumbnail_subset']);
-  $output .= drupal_render($form[$field][$delta]['thumbnail_list']);
+  $output = drupal_render($element['thumbnail_subset']);
+  $output .= drupal_render($element['thumbnail_list']);
   $output .= theme('status_messages');
-
-  drupal_json_encode(array(
-    'status' => TRUE,
-    'data' => $output,
-  ));
-
-  exit();
+  return $output;
 }
 
