Added unit tests for image extraction