% const sheets = this.sheets.filter(sheet => Boolean(sheet.image)); %> <% const pages = sheets.map((v, i) => sheets.slice(i, i + 2)).filter(Boolean); %>