fix issue #30 about flat and dark management