Refactoring of Image model to reduce number of times the filesystem is accessed.