Sample code to read chapters (with images) from media files