diff --git a/galleria.galleria_default_preset.inc b/galleria.galleria_default_preset.inc
new file mode 100644
index 0000000..f3be659
--- /dev/null
+++ b/galleria.galleria_default_preset.inc
@@ -0,0 +1,30 @@
+<?php
+
+/**
+ * @file
+ * Bulk export of default_galleria_presets objects generated by Bulk export
+ */
+
+/**
+ * Implementation of hook_galleria_default_presets()
+ */
+function galleria_galleria_default_presets() {
+  $presets = array();
+
+  $preset = new stdClass;
+  $preset->disabled = FALSE; /* Edit this to true to make a default preset disabled initially */
+  $preset->api_version = 1;
+  $preset->name = 'default';
+  $preset->title = 'Default';
+  $preset->theme = 'classic';
+  $preset->imagestyle_thumb = 'galleria_thumb';
+  $preset->imagestyle_normal = 'galleria_zoom';
+  $preset->imagestyle_big = 'galleria_full_screen';
+  $preset->options = array(
+    'height' => 300,
+    'width' => 450,
+  );
+  $presets['default'] = $preset;
+
+  return $presets;
+}
\ No newline at end of file
diff --git a/galleria.info b/galleria.info
index 5f9c41c..de45b4b 100644
--- a/galleria.info
+++ b/galleria.info
@@ -3,6 +3,7 @@ description = Turns image fields of nodes into Galleria galleries with this Java
 core = 7.x
 configure = admin/config/media/galleria
 
+dependencies[] = ctools
 dependencies[] = image
 dependencies[] = libraries
 
diff --git a/galleria.install b/galleria.install
index 5e3c4de..3ce394c 100644
--- a/galleria.install
+++ b/galleria.install
@@ -12,6 +12,17 @@ function galleria_schema() {
   return array(
     'galleria_optionset' => array(
       'description' => 'Store option sets for Galleria instances.',
+      'export' => array(
+        'key' => 'name',
+        'identifier' => 'preset',
+        'default hook' => 'galleria_default_presets',
+        'api' => array(
+          'owner' => 'galleria',
+          'api' => 'galleria_default_preset',
+          'minimum_version' => 1,
+          'current_version' => 1,
+        ),
+      ),
       'fields' => array(
         'name' => array(
           'description' => 'The machine-readable option set name.',
@@ -51,7 +62,7 @@ function galleria_schema() {
           'type' => 'varchar',
           'length' => 255,
           'not null' => TRUE,
-          'default' => '', // original image
+          'default' => 'galleria_full_screen', // original image
         ),
         'options' => array(
           'description' => 'The options array.',
@@ -198,21 +209,4 @@ function galleria_update_7002() {
       }
     }
   }
-}
-
-
-/**
- * Implements hook_install().
- * Adds a 'default' option set for fresh installs.
- */
-function galleria_install() {
-  $optionset = array(
-    'name' => 'default',
-    'title' => 'Default',
-    'options' => array(
-      'height' => 300,
-      'width' => 450,
-    ),
-  );
-  galleria_optionset_save($optionset, TRUE);
-}
+}
\ No newline at end of file
diff --git a/galleria.module b/galleria.module
index 5a81daf..bbde7a7 100644
--- a/galleria.module
+++ b/galleria.module
@@ -5,6 +5,17 @@
  */
 
 /**
+ * Implements hook_permission().
+ */
+function galleria_permission(){
+  return array(
+    'administer galleria' => array(
+      'title' => t('Administer the Galleria module'),
+    ),
+  );
+}
+
+/**
  * Implements hook_menu().
  */
 function galleria_menu() {
@@ -14,7 +25,7 @@ function galleria_menu() {
     'title' => 'Galleria',
     'description' => 'Configure Galleria image galleries.',
     'page callback' => 'galleria_page_optionset_list',
-    'access arguments' => array('administer site configuration'),
+    'access arguments' => array('administer galleria'),
     'file' => 'includes/galleria.admin.inc',
   );
   $items['admin/config/media/galleria/list'] = array(
@@ -28,7 +39,7 @@ function galleria_menu() {
     'description' => 'Add a new Galleria option set.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('galleria_form_optionset_add'),
-    'access arguments' => array('administer site configuration'),
+    'access arguments' => array('administer galleria'),
     'type' => MENU_LOCAL_ACTION,
     'weight' => 1,
     'file' => 'includes/galleria.admin.inc',
@@ -38,7 +49,7 @@ function galleria_menu() {
     'description' => 'Configure an option set.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('galleria_form_optionset_edit', 5),
-    'access arguments' => array('administer site configuration'),
+    'access arguments' => array('administer galleria'),
     'file' => 'includes/galleria.admin.inc',
   );
   $items['admin/config/media/galleria/delete/%galleria_optionset'] = array(
@@ -46,7 +57,7 @@ function galleria_menu() {
     'description' => 'Delete an option set.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('galleria_optionset_form_delete', 5),
-    'access arguments' => array('administer site configuration'),
+    'access arguments' => array('administer galleria'),
     'file' => 'includes/galleria.admin.inc',
   );
   $items['admin/config/media/galleria/advanced'] = array(
@@ -54,11 +65,29 @@ function galleria_menu() {
     'description' => 'Configure the advanced Galleria module settings.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('galleria_form_settings'),
-    'access arguments' => array('administer site configuration'),
+    'access arguments' => array('administer galleria'),
     'type' => MENU_LOCAL_TASK,
     'weight' => 2,
     'file' => 'includes/galleria.admin.inc',
   );
+  $items['admin/config/media/galleria/import'] = array(
+    'title' => 'Import',
+    'description' => 'Import Galleria option sets',
+    'page callback' => 'galleria_form_optionset_import',
+    'access arguments' => array('administer galleria'),
+    'type' => MENU_LOCAL_TASK,
+    'weight' => 3,
+    'file' => 'includes/galleria.admin.inc',
+  );
+  $items['admin/config/media/galleria/export'] = array(
+    'title' => 'Export',
+    'description' => 'Export Galleria option sets',
+    'page callback' => 'galleria_form_optionset_export',
+    'access arguments' => array('administer galleria'),
+    'type' => MENU_LOCAL_TASK,
+    'weight' => 4,
+    'file' => 'includes/galleria.admin.inc',
+  );
 
   return $items;
 }
@@ -129,10 +158,30 @@ function galleria_image_default_styles() {
     )
   );
 
+  // image preset for full screen
+  $styles['galleria_full_screen'] = array(
+    'effects' => array(
+      array(
+        'name' => 'image_scale',
+        'data' => array('width' => 800, 'height' => 600, 'upscale' => 1),
+        'weight' => 0,
+      ),
+    )
+  );
+
   return $styles;
 }
 
 /**
+ * Implements hook_ctools_plugin_api().
+ */
+function galleria_ctools_plugin_api($owner, $api){
+  if ($owner == 'galleria' && $api == 'galleria_default_preset'){
+    return array('version' => 1);
+  }
+}
+
+/**
  * Implements hook_views_api().
  *
  * This tells drupal that there is Views integration file named
@@ -148,22 +197,18 @@ function galleria_views_api() {
 /**
  * Fetches all option sets from the database and returns them as an associative array.
  */
-function galleria_optionsets() {
-  $optionsets = db_query("SELECT * FROM {galleria_optionset}")->fetchAllAssoc('name', PDO::FETCH_ASSOC);
-  foreach ($optionsets as &$optionset) {
-    $optionset['options'] = empty($optionset['options']) ? array() : unserialize($optionset['options']);
-  }
+function galleria_optionsets_load_all() {
+  ctools_include('export');
+  $optionsets = ctools_export_crud_load_all('galleria_optionset');
   return $optionsets;
 }
 
 /**
- * Fetches the given option set and returns it as an associative array or FALSE, if no set could be found.
+ * Fetches the given option set and returns it as an object or NULL, if no set could be found.
  */
 function galleria_optionset_load($optionset_name) {
-  $optionset = db_query("SELECT * FROM {galleria_optionset} WHERE name = :name", array(':name' => $optionset_name))->fetchAssoc();
-  if ($optionset !== FALSE) {
-    $optionset['options'] = empty($optionset['options']) ? array() : unserialize($optionset['options']);
-  }
+  ctools_include('export');
+  $optionset = ctools_export_crud_load('galleria_optionset', $optionset_name);
   return $optionset;
 }
 
@@ -171,7 +216,8 @@ function galleria_optionset_load($optionset_name) {
  * Checks whether an option set with the given name already exists.
  */
 function galleria_optionset_exists($optionset_name) {
-  return (galleria_optionset_load($optionset_name) !== FALSE);
+  ctools_include('export');
+  return (ctools_export_crud_load('galleria_optionset', $optionset_name) !== NULL);
 }
 
 /**
@@ -197,7 +243,7 @@ function galleria_optionset_save($optionset, $new = FALSE) {
  * Deletes the given option set from the database.
  */
 function galleria_optionset_delete($optionset) {
-  db_delete('galleria_optionset')->condition('name', $optionset['name'])->execute();
+  db_delete('galleria_optionset')->condition('name', $optionset->name)->execute();
   // TODO: update formatters?
   return TRUE;
 }
@@ -314,8 +360,8 @@ function galleria_field_formatter_settings_form($field, $instance, $view_mode, $
 
   // Show select box for the option set
   $optionsets = array();
-  foreach (galleria_optionsets() as $name => $optionset) {
-    $optionsets[$name] = check_plain($optionset['title']);
+  foreach (galleria_optionsets_load_all() as $name => $optionset) {
+    $optionsets[$name] = check_plain($optionset->title);
   }
   $form['optionset'] = array(
     '#title' => t('Option set'),
@@ -377,8 +423,8 @@ function galleria_field_formatter_settings_summary($field, $instance, $view_mode
   $optionset = t('Default settings');
   if (!empty($settings['optionset'])) {
     $o = galleria_optionset_load($settings['optionset']);
-    if ($o !== FALSE) {
-      $optionset = $o['title'];
+    if ($o !== NULL) {
+      $optionset = $o->title;
     }
   }
   $summary[] = t('Option set: %optionset', array('%optionset' => $optionset));
@@ -406,12 +452,12 @@ function galleria_field_formatter_settings_summary($field, $instance, $view_mode
 
 /**
  * Implements hook_field_formatter_prepare_view().
- * 
+ *
  * Loads the attached nodes for node_reference fields so we can later access the image fields.
  */
 function galleria_field_formatter_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items, $displays) {
   if ($field['type'] == 'node_reference') {
-    // Collect ids to load. 
+    // Collect ids to load.
     $ids = array();
     foreach ($displays as $id => $display) {
       foreach ($items[$id] as $item) {
@@ -523,7 +569,7 @@ function galleria_add_js($id, $optionset) {
   // Theme
   //   As it's only possible to use one theme per page, use the first one we get for everything.
   if (empty($cache['theme'])) {
-    $theme = (!empty($optionset['theme'])) ? $optionset['theme'] : 'classic';
+    $theme = (!empty($optionset->theme)) ? $optionset->theme : 'classic';
     $theme_file = galleria_get_theme_file($theme);
     if (($theme_file === FALSE) && ($theme !== 'classic')) {
       // Try to fall back to classic theme, the other one might have been deleted.
@@ -536,10 +582,10 @@ function galleria_add_js($id, $optionset) {
   $js_settings = array(
     'themepath' => file_create_url($cache['theme']),
     'optionsets' => array(
-      $optionset['name'] => $optionset['options'],
+      $optionset->name => $optionset->options,
     ),
     'instances' => array(
-      'galleria-' . $id => $optionset['name'],
+      'galleria-' . $id => $optionset->name,
     ),
   );
   drupal_add_js(array('galleria' => $js_settings), 'setting');
diff --git a/includes/galleria.admin.inc b/includes/galleria.admin.inc
index 8537c74..628b961 100644
--- a/includes/galleria.admin.inc
+++ b/includes/galleria.admin.inc
@@ -9,16 +9,19 @@
  * Menu callback; Listing of all current option sets.
  */
 function galleria_page_optionset_list() {
-  $optionsets = galleria_optionsets();
+  $optionsets = galleria_optionsets_load_all();
 
   $header = array(t('Option Set Name'), array('data' => t('Operations'), 'colspan' => 2));
   $rows = array();
   foreach ($optionsets as $name => $optionset) {
+    $is_overridden = ($optionset->export_type & EXPORT_IN_CODE) ? TRUE : FALSE;
+
     $rows[] = array(
-      l($optionset['title'], 'admin/config/media/galleria/edit/' . $name),
+      l($optionset->title, 'admin/config/media/galleria/edit/' . $name),
       l(t('edit'), 'admin/config/media/galleria/edit/' . $name),
-      // Hide the delete link for the 'default' set
-      ($name == 'default') ? '' : l(t('delete'), 'admin/config/media/galleria/delete/' . $name),
+
+      // Only print revert/delete links if we have something in the db to delete
+      (!isset($optionset->in_code_only)) ? l(t($is_overridden ? 'revert' : 'delete'), 'admin/config/media/galleria/delete/' . $name) : '',
     );
   }
 
@@ -71,17 +74,21 @@ function galleria_form_optionset_add($form, &$form_state) {
  * Submit handler for adding a new option set.
  */
 function galleria_form_optionset_add_submit($form, &$form_state) {
-  $optionset = array(
-    'name' => $form_state['values']['name'],
-    'title' => $form_state['values']['title'],
-    'options' => array(
+  ctools_include('export');
+
+  $optionset = ctools_export_crud_new('galleria_optionset');
+
+  $optionset->name = $form_state['values']['name'];
+  $optionset->title = $form_state['values']['title'];
+  $optionset->options = array(
       'height' => 300,
       'width' => 450,
-    ),
   );
-  $optionset = galleria_optionset_save($optionset, TRUE);
-  drupal_set_message(t('Option set %name was created.', array('%name' => $optionset['name'])));
-  $form_state['redirect'] = 'admin/config/media/galleria/edit/' . $optionset['name'];
+
+  $saved = ctools_export_crud_save('galleria_optionset', $optionset);
+
+  drupal_set_message(t('Option set %name was created.', array('%name' => $optionset->name)));
+  $form_state['redirect'] = 'admin/config/media/galleria/edit/' . $optionset->name;
 }
 
 
@@ -529,7 +536,7 @@ function galleria_form_optionset_edit($form, &$form_state, $optionset) {
 
   // Print a warning if there's no height and/or width option in the set.
   foreach (array('height', 'width') as $dimension) {
-    if (!array_key_exists($dimension, $optionset['options'])) {
+    if (!array_key_exists($dimension, $optionset->options)) {
       drupal_set_message(t('You should add a %dimension option if you don\'t plan to set it manually via CSS.', array('%dimension' => $dimension)), 'warning');
     }
   }
@@ -539,7 +546,7 @@ function galleria_form_optionset_edit($form, &$form_state, $optionset) {
     '#type' => 'textfield',
     '#maxlength' => '255',
     '#title' => t('Title'),
-    '#default_value' => $optionset['title'],
+    '#default_value' => $optionset->title,
     '#description' => t('A human-readable title for this option set.'),
     '#required' => TRUE,
   );
@@ -560,7 +567,7 @@ function galleria_form_optionset_edit($form, &$form_state, $optionset) {
       '#title' => t('Theme'),
       '#description' => t('As you have more than one Galleria theme installed, please select the one to use.'),
       '#options' => array_combine($themes, $themes),
-      '#default_value' => $optionset['theme'],
+      '#default_value' => $optionset->theme,
     );
   }
 
@@ -577,7 +584,7 @@ function galleria_form_optionset_edit($form, &$form_state, $optionset) {
     '#description' => t('Image style for the thumbnail bar.'),
     '#empty_option' => t('None (original image)'),
     '#options' => $image_styles,
-    '#default_value' => $optionset['imagestyle_thumb'],
+    '#default_value' => $optionset->imagestyle_thumb,
   );
   $form['image_styles']['normal'] = array(
     '#type' => 'select',
@@ -585,7 +592,7 @@ function galleria_form_optionset_edit($form, &$form_state, $optionset) {
     '#description' => t('Image style for the main stage images.'),
     '#empty_option' => t('None (original image)'),
     '#options' => $image_styles,
-    '#default_value' => $optionset['imagestyle_normal'],
+    '#default_value' => $optionset->imagestyle_normal,
   );
   $form['image_styles']['big'] = array(
     '#type' => 'select',
@@ -593,7 +600,7 @@ function galleria_form_optionset_edit($form, &$form_state, $optionset) {
     '#description' => t('Image style for lightbox or fullscreen theme.'),
     '#empty_option' => t('None (original image)'),
     '#options' => $image_styles,
-    '#default_value' => $optionset['imagestyle_big'],
+    '#default_value' => $optionset->imagestyle_big,
   );
 
   // Option table
@@ -604,7 +611,7 @@ function galleria_form_optionset_edit($form, &$form_state, $optionset) {
   );
 
   $i = 0;
-  foreach ($optionset['options'] as $key => $value) {
+  foreach ($optionset->options as $key => $value) {
     $option_element = galleria_option_element($key, $value);
 
     $form['options'][] = array(
@@ -628,7 +635,7 @@ function galleria_form_optionset_edit($form, &$form_state, $optionset) {
   }
 
   // 'Add option' row at the end of the table
-  $options = array_diff(array_keys(galleria_option_elements()), array_keys($optionset['options']));
+  $options = array_diff(array_keys(galleria_option_elements()), array_keys($optionset->options));
   $options = empty($options) ? array() : array_combine($options, $options);
   $form['options'][] = array(
     'add_option_row' => array(
@@ -764,9 +771,9 @@ function galleria_form_optionset_edit_submit_add($form, &$form_state) {
 
   if (isset($new_option_element)) {
     $new_option = $form_state['values'][$new_option_element];
-    if (!array_key_exists($new_option, $optionset['options'])) {
+    if (!array_key_exists($new_option, $optionset->options)) {
       // Add the new option with a NULL value. The input element cares for a default value.
-      $optionset['options'][$new_option] = NULL;
+      $optionset->options[$new_option] = NULL;
       // Reset the input field
       $form_state['input'][$new_option_element] = '';
       drupal_set_message(t('Option %name added.', array('%name' => $new_option)));
@@ -788,7 +795,7 @@ function galleria_form_optionset_edit_submit_delete($form, &$form_state) {
   $rowindex = $form_state['triggering_element']['#parents'][1];
   $option = $form['options'][$rowindex]['value']['#option_name'];
 
-  unset($optionset['options'][$option]);
+  unset($optionset->options[$option]);
   drupal_set_message(t('Option %name removed.', array('%name' => $option)));
 
   $form_state['rebuild'] = TRUE;
@@ -800,11 +807,11 @@ function galleria_form_optionset_edit_submit_delete($form, &$form_state) {
 function galleria_form_optionset_edit_submit($form, &$form_state) {
   $optionset = &$form_state['optionset'];
 
-  $optionset['title'] = $form_state['values']['title'];
-  $optionset['theme'] = $form_state['values']['theme'];
-  $optionset['imagestyle_thumb']  = $form_state['values']['image_styles']['thumb'];
-  $optionset['imagestyle_normal'] = $form_state['values']['image_styles']['normal'];
-  $optionset['imagestyle_big']    = $form_state['values']['image_styles']['big'];
+  $optionset->title = $form_state['values']['title'];
+  $optionset->theme = $form_state['values']['theme'];
+  $optionset->imagestyle_thumb  = $form_state['values']['image_styles']['thumb'];
+  $optionset->imagestyle_normal = $form_state['values']['image_styles']['normal'];
+  $optionset->imagestyle_big    = $form_state['values']['image_styles']['big'];
 
   foreach ($form_state['values']['options'] as $index => $values) {
     $element = $form['options'][$index]['value'];
@@ -827,11 +834,13 @@ function galleria_form_optionset_edit_submit($form, &$form_state) {
     }
 
     $option = $element['#option_name'];
-    $optionset['options'][$option] = $value;
+    $optionset->options[$option] = $value;
   }
 
-  galleria_optionset_save($optionset);
-  drupal_set_message(t('Option set %name changed.', array('%name' => $optionset['name'])));
+  ctools_include('export');
+  ctools_export_crud_save('galleria_optionset', $optionset);
+
+  drupal_set_message(t('Option set %name changed.', array('%name' => $optionset->name)));
   $form_state['redirect'] = 'admin/config/media/galleria';
 }
 
@@ -842,12 +851,15 @@ function galleria_form_optionset_edit_submit($form, &$form_state) {
 function galleria_optionset_form_delete($form, &$form_state, $optionset) {
   $form_state['optionset'] = &$optionset;
 
+  // Deleting an export in code will revert it.
+  $op = ($optionset->export_type & EXPORT_IN_CODE) ? 'Revert' : 'Delete';
+
   return confirm_form(
     $form,
-    t('Are you sure you want to delete the option set %name?', array('%name' => $optionset['name'])),
+    t('Are you sure you want to @action the option set %name?', array('@action' => t(drupal_strtolower($op)), '%name' => $optionset->name)),
     'admin/config/media/galleria',
     NULL,
-    t('Delete'),  t('Cancel')
+    t($op),  t('Cancel')
   );
 }
 
@@ -857,14 +869,10 @@ function galleria_optionset_form_delete($form, &$form_state, $optionset) {
 function galleria_optionset_form_delete_submit($form, &$form_state) {
   $optionset = &$form_state['optionset'];
 
-  if ($optionset['name'] == 'default') {
-    // Prevent deletion of the default set so we can fall back to it.
-    drupal_set_message(t('The default option set may not be deleted!', 'error'));
-  }
-  else {
-    galleria_optionset_delete($optionset);
-    drupal_set_message(t('Option set %name was deleted.', array('%name' => $optionset['name'])));
-  }
+  $op = ($optionset->export_type & EXPORT_IN_CODE) ? 'reverted' : 'deleted';
+  ctools_include('export');
+  ctools_export_crud_delete('galleria_optionset', $optionset);
+  drupal_set_message(t('Option set %name was ' . $op . '.', array('%name' => $optionset->name)));
 
   $form_state['redirect'] = 'admin/config/media/galleria';
 }
@@ -945,3 +953,38 @@ function galleria_form_settings_submit_clearcache($form, &$form_state) {
 function galleria_form_settings_submit($form, &$form_state) {
   drupal_set_message(t('NYI: Nothing done.'));
 }
+
+/**
+ * Export option sets
+ */
+function galleria_form_optionset_export() {
+  $output = '';
+
+  // Check for an appropriate export tool
+  if (module_exists('bulk_export') || module_exists('features')) {
+    $output .= 'Use any of the following to export your option sets.';
+    $output .= '<ul>';
+    if (module_exists('bulk_export')) {
+      $output .= '<li>' . l('Bulk Export', 'admin/structure/bulk-export') . '</li>';
+    }
+    if (module_exists('features')) {
+      $output .= '<li>' . l('Features', 'admin/structure/features') . '</li>';
+    }
+    $output .= '</ul>';
+  }
+  // Advise the user on tools available to them
+  else {
+    $output .= t('Enable the <a href="http://drupal.org/project/ctools">Bulk Export module</a> or the <a href="http://drupal.org/project/features">Features module</a> to export your option sets.');
+  }
+
+  return $output;
+}
+
+/**
+ * Import option set form
+ */
+function galleria_form_optionset_import() {
+  $output = '<p>' . t('At present, the only method of importing option sets is by including the preset in a module. The Features module can simplify this process.') . '</p>';
+  $output .= '<p>' . t('A form based import/export mechanism will be added in the future.') . '</p>';
+  return $output;
+}
diff --git a/includes/views_plugin_style_galleria.inc b/includes/views_plugin_style_galleria.inc
index b9b8a65..8a7447f 100644
--- a/includes/views_plugin_style_galleria.inc
+++ b/includes/views_plugin_style_galleria.inc
@@ -35,7 +35,7 @@ class views_plugin_style_galleria extends views_plugin_style {
     );
 
     $optionsets = array();
-    foreach (galleria_optionsets() as $name => $optionset) {
+    foreach (galleria_optionsets_load_all() as $name => $optionset) {
       $optionsets[$name] = check_plain($optionset['title']);
     }
     $form['galleria']['galleria_optionset'] = array(
diff --git a/theme/theme.inc b/theme/theme.inc
index 116b733..d318a6b 100644
--- a/theme/theme.inc
+++ b/theme/theme.inc
@@ -2,7 +2,7 @@
 /**
  * @file
  * Theming functions for the Galleria module.
- * 
+ *
  * Preprocessor functions fill variables for templates and helper
  * functions to make theming easier.
  */
@@ -30,7 +30,7 @@ function template_preprocess_galleria_container(&$vars) {
   // Prepare image elements
   $items = $vars['items'];
   $vars['items'] = array();
-  $thumb_style = empty($optionset['imagestyle_thumb']) ? 'galleria_thumb' : $optionset['imagestyle_thumb'];
+  $thumb_style = empty($optionset->imagestyle_thumb) ? 'galleria_thumb' : $optionset->imagestyle_thumb;
   foreach ($items as $delta => $item) {
     // Stop errors for empty URI. See issue [#1319268] for details.
     if (empty($item['uri'])) {
@@ -38,19 +38,19 @@ function template_preprocess_galleria_container(&$vars) {
     }
 
     // Get URL for "normal" image
-    if (empty($optionset['imagestyle_normal'])) {
+    if (empty($optionset->imagestyle_normal)) {
        $normal_url = file_create_url($item['uri']);
     }
     else {
-       $normal_url = image_style_url($optionset['imagestyle_normal'], $item['uri']);
+       $normal_url = image_style_url($optionset->imagestyle_normal, $item['uri']);
     }
 
     // Get URL for "big" image (for lightbox and fullscreen)
-    if (empty($optionset['imagestyle_big'])) {
+    if (empty($optionset->imagestyle_big)) {
       $big_url = file_create_url($item['uri']);
     }
-    elseif ($optionset['imagestyle_big'] != $optionset['imagestyle_normal']) {
-      $big_url = image_style_url($optionset['imagestyle_big'], $item['uri']);
+    elseif ($optionset->imagestyle_big != $optionset->imagestyle_normal) {
+      $big_url = image_style_url($optionset->imagestyle_big, $item['uri']);
     }
 
     if (!empty($big_url)) {
