Refactor code to import same decorator
Add `requires_img_lib` decorator and use it in test_image and test_dataio.
Update test_image to reduce redundancies.