.photopile { 
  display: flex; 
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  max-width: 100%;
}
.photopile figure { 
  display: inline-block;
  max-width: 40%;
  background: white;
  box-shadow: 1px 4px 5px rgba(0,0,0,0.55);
  transform: rotate(2deg);
  margin: 0 -25px;
}
.photopile figure img {
  max-width: calc(100% - 2rem);
  margin: 1rem 1rem 0 1rem;
  border: 2px rgb(0,0,0,0.55) inset;
}
.photopile figcaption {
  text-align: center;
  margin: 0.5rem 1rem 1rem 1rem;
  font-size: 1rem;
  color: black;
}
.photopile figure:hover { 
  z-index: 3;
}
.photopile figure:nth-child(2n) { 
  transform: rotate(-10deg);
}
.photopile figure:nth-child(3n) {
  transform: rotate(5deg);
}
.photopile figure:nth-child(4n) { 
  transform: rotate(4deg);
}
.photopile figure:nth-child(5n) { 
  transform: rotate(-2deg);
}
.photopile figure:nth-child(6n) {
  transform: rotate(-7deg);
}