add version number to raw images files; refactoring