body {
  margin: 0;
  padding: 0;
}

img {
  width: 100vw;
  height: 100vh;
}
const numItemsToGenerate = 1; 

function renderItem(){
  fetch(`https://source.unsplash.com/1600x900/?beach`).then((response)=> {   
    let item = document.createElement('div');
    item.classList.add('item');
    item.innerHTML = `
      <img class="beach-image" src="${response.url}" alt="beach image"/>
    `     
    document.body.appendChild(item);
  }) 
}
for(let i=0;i<numItemsToGenerate;i++){
  renderItem();
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.