adapting it for the im7 image files