final IndividualCandidacyDocumentFileType type = file.getCandidacyFileType();
if (type == IndividualCandidacyDocumentFileType.PHOTO) {
final Registration registration = candidacy.getRegistration();
if (registration != null) {
final Person person = registration.getPerson();
final Photograph personalPhotoEvenIfPending = person.getPersonalPhotoEvenIfPending();
if (personalPhotoEvenIfPending == null) {
missing++;
final byte[] content = file.getContent();
if (content != null && content.length > 0) {
withContent++;
final ContentType contentType = ContentType.getContentType(file.getContentType());
if (contentType != null) {
withContentType++;
if (chew(content)) {
final Photograph p = new Photograph(PhotoType.INSTITUTIONAL, contentType, content);
p.setState(PhotoState.APPROVED);
person.setPersonalPhoto(p);
fixed++;
} else {
unableToProcessImage++;
}