Added validation when extracting portrait data.