added first Deriv calc function and reading first img set