Refactor NdbImage into its own module.