fix issue with image extraction