code: @PrePersist
      @PreUpdate
      private void updateImageData() throws CustomConstraintViolationException {
          thumbnail = createImage(true);
          imageFile.validate();
          if (imageData != null) {
              imageContentHash = HashUtilities.generateSHA256(imageData).toCharArray();
          }
      }
docs: Create the thumbnails, and make sure the parent imagefile is valid.
  
  @throws CustomConstraintViolationException