Fixed attachment database recording. Mostly finished detail view.