Added class templates for refactoring of internal image data representation