Added real image support, refactored model class.