If an image cannot be detected, an exception is thrown. If data in stream are Microsoft Office 2007 password protected format an exception is thrown like format is not detected because it impossible to detect this format. The information about specific format is password protected too.