code: function getImageSize(element) {
              var imageObj = url.parse(element.attribs.src),
                  requestOptions,
                  timeout = 3000;
  
              if (!validator.isURL(imageObj.href)) {
                  // revert this element, do not show
                  element.name = 'img';
  
                  return enter();
              }
  
              // We need the user-agent, otherwise some https request may fail (e. g. cloudfare)
              requestOptions = {
                  headers: {
                      'User-Agent': 'Mozilla/5.0 Safari/537.36'
                  },
                  timeout: timeout,
                  encoding: null
              };
  
              return got(
                  imageObj.href,
                  requestOptions
              ).then(function (response) {
                  try {
                      // Using the Buffer rather than an URL requires to use sizeOf synchronously.
                      // See https://github.com/image-size/image-size#asynchronous
                      var dimensions = sizeOf(response.body);
  
                      // CASE: `.ico` files might have multiple images and therefore multiple sizes.
                      // We return the largest size found (image-size default is the first size found)
                      if (dimensions.images) {
                          dimensions.width = _.maxBy(dimensions.images, function (w) {return w.width;}).width;
                          dimensions.height = _.maxBy(dimensions.images, function (h) {return h.height;}).height;
                      }
  
                      element.attribs.width = dimensions.width;
                      element.attribs.height = dimensions.height;
  
                      return getLayoutAttribute(element);
                  } catch (err) {
                      // revert this element, do not show
                      element.name = 'img';
                      return enter();
                  }
              }).catch(function () {
                  // revert this element, do not show
                  element.name = 'img';
                  return enter();
              });
          }
docs: Get the image sizes (width and heigth plus type of image)
  
  https://github.com/image-size/image-size
  
  @param {Object} element
  @return {Object} element incl. width and height