BAC-86: Add a hook to check if uploaded image file is corrupted

Use ImageMagick's ``identify`` binary to validate uploaded images (works way better than GD).