Sorts all keys in configuration data.
Since we can not be sure of the order of the UUID's generated by _image_update_get_style_with_effects() we need to sort the data in order to compare it with data saved in the config system.
array $data: An associative array to sort recursively by key name.
array A sorted array.
public function sortByKey(array $data) {
  ksort($data);
  foreach ($data as &$value) {
    if (is_array($value)) {
      $this
        ->sortByKey($value);
    }
  }
  return $data;
}