added some codefragments for image processing