refactoring take one. also added methods to persist the image counter to a file in internal storage