public static void showGallery(Long id, String name) {
    notFoundIfNull(id);
    Gallery gallery = Gallery.findById(id);
    notFoundIfNull(gallery);

    List<Picture> pictures = gallery.getPictures();
    List<ImageView> images = new ArrayList<ImageView>();
    for (Picture picture : pictures) images.add(picture.toImageView());

    render("Application/gallery.html", images, gallery);
  }
 public static void resized(Long galleryId, Long pictureId) {
   File picture = Picture.getFile(galleryId, pictureId, Application.RESIZED);
   if (!picture.exists()) notFound();
   renderBinary(picture);
 }
 public static void thumbnail(Long galleryId, Long pictureId) {
   File picture = Picture.getFile(galleryId, pictureId, Application.THUMBNAILS);
   if (!picture.exists()) notFound();
   renderBinary(picture);
 }