diff --git a/picture.module b/picture.module
index 38e6c2a..e105f0e 100644
--- a/picture.module
+++ b/picture.module
@@ -101,7 +101,7 @@ function picture_mapping_load($name) {
   ctools_include('export');
   if ($name) {
     $mappings = ctools_export_load_object('picture_mapping', 'names', array($name));
-    $mapping = isset($mappings[$name]) ? $mappings[$name] : FALSE;
+    $mapping = $mappings[$name] ?? FALSE;
     return $mapping;
   }
   return FALSE;
@@ -230,7 +230,7 @@ function picture_library() {
             'weight' => -10,
             'group' => JS_DEFAULT,
             'scope' => variable_get('picture_js_scope', 'footer'),
-            'need_jquery' => FALSE
+            'need_jquery' => FALSE,
           ),
         ),
       );
@@ -244,7 +244,7 @@ function picture_library() {
             'weight' => -10,
             'group' => JS_DEFAULT,
             'scope' => variable_get('picture_js_scope', 'footer'),
-            'need_jquery' => FALSE
+            'need_jquery' => FALSE,
           ),
         ),
       );
@@ -255,15 +255,15 @@ function picture_library() {
         'js' => array(
           drupal_get_path('module', 'picture') . '/lazysizes/lazysizes.js' => array(
             'type' => 'file',
-            // file has async, put before all files to prevent JS concatenation breaking
+            // File has async, put before all files to prevent
+            // JS concatenation breaking.
             'weight' => -20,
             'group' => JS_LIBRARY,
-            'need_jquery' => FALSE
+            'need_jquery' => FALSE,
           ),
         ),
       );
 
-
       $libraries['lazysizes_aspect_ratio'] = array(
         'title' => t('Aspect ratio plugin for lazysizes'),
         'version' => '1.0.1',
@@ -456,7 +456,7 @@ function picture_field_formatter_settings_picture_form($field, $instance, $setti
     $element['picture_mapping'] = array(
       '#title' => t('Picture mapping'),
       '#type' => 'select',
-      '#default_value' => isset($settings['picture_mapping']) ? $settings['picture_mapping'] : '',
+      '#default_value' => $settings['picture_mapping'] ?? '',
       '#required' => TRUE,
       '#options' => picture_get_mapping_options(),
     );
@@ -489,7 +489,7 @@ function picture_field_formatter_settings_picture_form($field, $instance, $setti
     '#title' => t('Picture lazyload'),
     '#description' => t('Image will be rendered when it appears in viewport, helps to optimize page load speed.'),
     '#type' => 'checkbox',
-    '#default_value' => $settings['lazyload'] ? $settings['lazyload'] : FALSE ,
+    '#default_value' => $settings['lazyload'] ?? FALSE,
   );
 
   $element['lazyload_aspect_ratio'] = array(
@@ -836,7 +836,7 @@ function picture_field_formatter_settings_picture_sizes_formatter_summary($field
     )
   );
 
-  $summary[] = t('Fallback image style: @style', array('@style' => isset($image_styles[$settings['fallback_image_style']]) ? $image_styles[$settings['fallback_image_style']] : $image_styles[PICTURE_EMPTY_IMAGE]));
+  $summary[] = t('Fallback image style: @style', array('@style' => $image_styles[$settings['fallback_image_style']] ?? $image_styles[PICTURE_EMPTY_IMAGE]));
 
   $link_types = picture_link_types($instance);
   // Display this setting only if image is linked.
@@ -996,7 +996,7 @@ function picture_field_formatter_picture_view($entity_type, $entity, $field, $in
       $colorbox_settings = $display['settings']['colorbox_settings'];
 
       // Add the group ID.
-      list($id) = entity_extract_ids($entity_type, $entity);
+      [$id] = entity_extract_ids($entity_type, $entity);
       $entity_id = !empty($id) ? $entity_type . '-' . $id : 'entity-id';
       // If this is a file entity field check for the referencing entity to do
       // the proper grouping.
@@ -1068,7 +1068,10 @@ function picture_field_formatter_picture_view($entity_type, $entity, $field, $in
           break;
 
         case 'custom':
-          $caption = token_replace($colorbox_settings['colorbox_caption_custom'], array($entity_type => $entity, 'file' => (object) $item), array('clear' => TRUE));
+          $caption = token_replace($colorbox_settings['colorbox_caption_custom'], array(
+            $entity_type => $entity,
+            'file' => (object) $item,
+          ), array('clear' => TRUE));
           break;
 
         default:
@@ -1151,7 +1154,7 @@ function picture_field_formatter_picture_sizes_formatter_view($entity_type, $ent
       '#image_styles' => array_filter($settings['image_styles']),
       '#fallback_image_style' => $settings['fallback_image_style'] ? $settings['fallback_image_style'] : PICTURE_EMPTY_IMAGE,
       '#sizes' => $settings['sizes'],
-      '#path' => isset($uri) ? $uri : '',
+      '#path' => $uri ?? '',
       '#lazyload_data_attributes' => $settings['lazyload_data_attributes'],
       '#lazyload_class' => $settings['lazyload_class'],
     );
@@ -1177,14 +1180,14 @@ function theme_picture_formatter($variables) {
 
   $responsive_image = array(
     '#theme' => 'picture',
-    '#width' => isset($item['width']) ? $item['width'] : NULL,
-    '#height' => isset($item['height']) ? $item['height'] : NULL,
+    '#width' => $item['width'] ?? NULL,
+    '#height' => $item['height'] ?? NULL,
     '#style_name' => $variables['image_style'],
     '#breakpoints' => $variables['breakpoints'],
     '#uri' => $item['uri'],
-    '#alt' => isset($item['alt']) ? $item['alt'] : '',
-    '#attributes' => isset($item['attributes']) ? $item['attributes'] : NULL,
-    '#timestamp' => isset($item['timestamp']) ? $item['timestamp'] : NULL,
+    '#alt' => $item['alt'] ?? '',
+    '#attributes' => $item['attributes'] ?? NULL,
+    '#timestamp' => $item['timestamp'] ?? NULL,
     '#lazyload' => !empty($variables['lazyload']),
     '#lazyload_aspect_ratio' => !empty($variables['lazyload_aspect_ratio']),
   );
@@ -1200,7 +1203,7 @@ function theme_picture_formatter($variables) {
   }
   if (is_array($variables['path']) && isset($variables['path']['path'])) {
     $path = $variables['path']['path'];
-    $options = isset($variables['path']['options']) ? $variables['path']['options'] : array();
+    $options = $variables['path']['options'] ?? [];
     $options['html'] = TRUE;
     return l(drupal_render($responsive_image), $path, $options);
   }
@@ -1277,7 +1280,10 @@ function theme_picture_sizes_formatter($variables) {
 
     $output = theme('image_srcset', $variables);
     if (isset($variables['lazyload_data_attributes']) && $variables['lazyload_data_attributes']) {
-      $output = str_replace(array('src="', 'srcset="'), array('data-src="', 'data-srcset="'), $output);
+      $output = str_replace(array('src="', 'srcset="'), array(
+        'data-src="',
+        'data-srcset="',
+      ), $output);
     }
     return $output;
   }
@@ -1416,7 +1422,7 @@ function theme_picture(array $variables) {
               // Get mime type.
               // $derivative_mime_type = $mime_type;
               // $image_style->transformMimeType($derivative_mime_type);
-              // $derivative_mime_types[] = $derivative_mime_type;
+              // $derivative_mime_types[] = $derivative_mime_type;.
               $srcset[$dimensions_clone['width']] = _picture_image_style_url($image_style_name, $variables['uri'], $variables['timestamp']) . ' ' . $dimensions_clone['width'] . 'w';
               $sizes = array_merge(explode(',', $mapping_definition['sizes']), $sizes);
             }
@@ -1426,7 +1432,7 @@ function theme_picture(array $variables) {
             // Get mime type (not implemented in Drupal 7.
             // $derivative_mime_type = $mime_type;
             // $image_style->transformMimeType($derivative_mime_type);
-            // $derivative_mime_types[] = $derivative_mime_type;
+            // $derivative_mime_types[] = $derivative_mime_type;.
             $srcset[$multiplier] = _picture_image_style_url($mapping_definition['image_style'], $variables['uri'], $variables['timestamp']) . ' ' . $multiplier;
             break;
         }
@@ -1442,7 +1448,7 @@ function theme_picture(array $variables) {
           'height' => $variables['height'],
         );
         $dimensions = picture_get_image_dimensions($mapping_definition['image_style'], $dimensions);
-        // store as a string, JS plugin will do calculation
+        // store as a string, JS plugin will do calculation.
         $aspect_ratio = $dimensions['width'] . '/' . $dimensions['height'];
       }
 
@@ -1488,13 +1494,14 @@ function theme_picture(array $variables) {
         $attributes['class'] = array();
       }
       elseif (!is_array($attributes['class'])) {
-        $attributes['class'] = (array)$attributes['class'];
+        $attributes['class'] = (array) $attributes['class'];
       }
       $attributes['class'][] = 'lazyload';
     }
 
     if (!empty($variables['lazyload_aspect_ratio'])) {
-      // img tag has to have data-aspectratio attribute even if its dummy placeholder
+      // Img tag has to have data-aspectratio attribute
+      // even if its dummy placeholder.
       $attributes['data-aspectratio'] = '';
     }
 
@@ -1502,9 +1509,12 @@ function theme_picture(array $variables) {
       $min_ie9_fallback = array(
         '#theme' => 'image_srcset',
         '#uri' => $src,
-        '#alt' => isset($attributes['alt']) ? $attributes['alt'] : '',
-        '#title' => isset($attributes['title']) ? $attributes['title'] : '',
-        '#attributes' => array_diff_key($attributes, array('alt' => '', 'title' => '')),
+        '#alt' => $attributes['alt'] ?? '',
+        '#title' => $attributes['title'] ?? '',
+        '#attributes' => array_diff_key($attributes, array(
+          'alt' => '',
+          'title' => '',
+        )),
         '#lazyload' => !empty($variables['lazyload']),
       );
       $output[] = drupal_render($min_ie9_fallback);
@@ -1514,9 +1524,12 @@ function theme_picture(array $variables) {
       $min_ie9_fallback = array(
         '#theme' => 'image_srcset',
         '#uri' => $src,
-        '#alt' => isset($attributes['alt']) ? $attributes['alt'] : '',
-        '#title' => isset($attributes['title']) ? $attributes['title'] : '',
-        '#attributes' => array_diff_key($attributes, array('alt' => '', 'title' => '')),
+        '#alt' => $attributes['alt'] ?? '',
+        '#title' => $attributes['title'] ?? '',
+        '#attributes' => array_diff_key($attributes, array(
+          'alt' => '',
+          'title' => '',
+        )),
         '#lazyload' => !empty($variables['lazyload']),
       );
       $output[] = '<!--[if lt IE 9]>';
@@ -1535,9 +1548,12 @@ function theme_picture(array $variables) {
       $plus_ie8_fallback = array(
         '#theme' => 'image_srcset',
         '#srcset' => array($srcset),
-        '#alt' => isset($attributes['alt']) ? $attributes['alt'] : '',
-        '#title' => isset($attributes['title']) ? $attributes['title'] : '',
-        '#attributes' => array_diff_key($attributes, array('alt' => '', 'title' => '')),
+        '#alt' => $attributes['alt'] ?? '',
+        '#title' => $attributes['title'] ?? '',
+        '#attributes' => array_diff_key($attributes, array(
+          'alt' => '',
+          'title' => '',
+        )),
         '#lazyload' => !empty($variables['lazyload']),
       );
       $output[] = '<!--[if !lt IE 9]><!-->';
@@ -1588,7 +1604,7 @@ function theme_image_srcset(array $variables) {
   if (isset($variables['uri']) && !empty($variables['uri'])) {
     $attr_name = !empty($variables['lazyload']) ? 'data-src' : 'src';
 
-    // TODO: remove when https://www.drupal.org/node/1342504 is fixed.
+    // @todo remove when https://www.drupal.org/node/1342504 is fixed.
     if (strpos($variables['uri'], 'data:') === 0) {
       $attributes[$attr_name] = $variables['uri'];
     }
@@ -1602,7 +1618,7 @@ function theme_image_srcset(array $variables) {
       // URI is mandatory.
       if (isset($src['uri']) && !empty($src['uri'])) {
         $key = '';
-        // TODO: remove when https://www.drupal.org/node/1342504 is fixed.
+        // @todo remove when https://www.drupal.org/node/1342504 is fixed.
         if (strpos($src['uri'], 'data:') === 0) {
           $source = $src['uri'];
         }
@@ -1775,7 +1791,7 @@ function _picture_filter_prepare_image($image) {
     $mapping_id = $attributes['data-picture-group'];
   }
   else {
-    $mapping_id = null;
+    $mapping_id = NULL;
   }
   $mappings = picture_mapping_load($mapping_id);
   // Make sure we have valid mappings.
@@ -1809,7 +1825,6 @@ function _picture_filter_prepare_image($image) {
   $image_info = image_get_info($uri);
   // Check if stage_file_proxy is active.
   if (!$image_info && module_exists('stage_file_proxy')) {
-    $local = stage_file_proxy_process_file_uri($uri);
     $image_info = image_get_info($uri);
   }
 
@@ -1859,10 +1874,10 @@ function _picture_filter_prepare_image($image) {
           'width' => $image_info['width'],
           'height' => $image_info['height'],
         );
-        // Let the the image style transform the dimensions. This way we avoid the
-        // performance cost of actually having to generate the derivative. The
-        // image style can transform the dimensions without the derivative having
-        // to exist.
+        // Let the the image style transform the dimensions. This way we avoid
+        // the performance cost of actually having to generate the derivative.
+        // The image style can transform the dimensions without the derivative
+        // having to exist.
         $dimensions = picture_get_image_dimensions($image_style, $dimensions);
 
         $image_render_array['#srcset'][] = array(
@@ -1891,8 +1906,8 @@ function _picture_filter_prepare_image($image) {
       'data-picture-mapping' => $mapping_id,
     ) + $attributes,
     '#breakpoints' => $breakpoint_styles,
-    '#lazyload' => isset($picture_mappings[$mapping_id]['lazyload']) ? $picture_mappings[$mapping_id]['lazyload'] : FALSE,
-    '#lazyload_aspect_ratio' => isset($picture_mappings[$mapping_id]['lazyload_aspect_ratio']) ? $picture_mappings[$mapping_id]['lazyload_aspect_ratio'] : FALSE,
+    '#lazyload' => $picture_mappings[$mapping_id]['lazyload'] ?? FALSE,
+    '#lazyload_aspect_ratio' => $picture_mappings[$mapping_id]['lazyload_aspect_ratio'] ?? FALSE,
   );
   return $image_render_array;
 }
@@ -1956,7 +1971,8 @@ function picture_page_build(&$page) {
         'label' => $label,
         'ckeditorDefaultMapping' => variable_get('picture_ckeditor_default_mapping', 'not_set'),
         'editorCSS' => picture_ckeditor_css(),
-      )), 'setting');
+      ),
+    ), 'setting');
 
     // Do not add inline css, unless when editing.
     if (!isset($page['content']['system_main']['#node_edit_form']) || !$page['content']['system_main']['#node_edit_form']) {
@@ -2190,7 +2206,7 @@ function picture_wysiwyg_editor_settings_alter(&$settings, $context) {
       );
     }
     else {
-      // @todo: try finding the img entry and add data- attributes if needed.
+      // @todo try finding the img entry and add data- attributes if needed.
     }
   }
 }
