modified both files a little, integrated function to process the images.. seems not to work correct