code: function update(image) {
    if (image.lazyLoad) {
      return;
    }
  
    var rect = DOM.getRect(image.element);
    var foundBreakpoint;
  
    for (var i = 0; i < image.knownSizes.length; i++) {
      var s = image.knownSizes[i];
  
      if (rect.width <= s) {
        foundBreakpoint = s;
      } else {
        break;
      }
    }
  
    if (!foundBreakpoint) {
      foundBreakpoint = image.knownSizes[0];
    }
  
    if (foundBreakpoint !== image.currentBreakpoint || !image.hasRunOnce) {
      image.currentBreakpoint = foundBreakpoint;
      loadImageForBreakpoint(image, image.currentBreakpoint);
    }
  }
docs: Detect the current breakpoint and update the element if necessary.