Refactor code into new function image_path()
Add test_image_path()