If you're examining general ArticleGalley objects and not specifically ArticleHTMLGalley objects, reading the content may result in you reading data other than HTML and potentially quite a lot of it.   ArticleHTMLGalley gets you a lot of good things, like a method for reading the file contents.  I'd recommend using that class, but if you absolutely can't do that for some reason, you could look at the $articleGalley->getFileType() method which would give you the mime type instead.  Are you setting that to text/html when you create this galley?