corrected bugs and added the double source for image pixels