diff --git a/picture.module b/picture.module
index 0b477b2..b5be7ca 100644
--- a/picture.module
+++ b/picture.module
@@ -470,6 +470,9 @@ function picture_field_formatter_settings_form($field, $instance, $view_mode, $f
     '#default_value' => $settings['colorbox_settings']['colorbox_gallery'],
     '#options' => $gallery,
     '#description' => t('How Colorbox should group the image galleries.'),
+    '#attributes' => array(
+      'class' => array('picture-colorbox-gallery'),
+    ),
   );
   $element['colorbox_settings']['colorbox_gallery_custom'] = array(
     '#title' => t('Custom gallery'),
@@ -481,7 +484,7 @@ function picture_field_formatter_settings_form($field, $instance, $view_mode, $f
     '#required' => FALSE,
     '#states' => array(
       'visible' => array(
-        ':input[name$="[settings][colorbox_settings][colorbox_gallery]"]' => array('value' => 'custom'),
+        ':input[name$="[settings][colorbox_settings][colorbox_gallery]"].picture-colorbox-gallery' => array('value' => 'custom'),
       ),
     ),
   );
