Refactoring of image processing and archiving