added missing Map class import
added a flag 'extractimages' to the more complex extractContent calls