Added average histogram function
Fill event when pushing image to allow asynchronous image writing
Use event for better flow control on histogram generation
Fix check on global id when reading image
Adding histogram average test + make inegal size test on
bigger image
Average the job results before concatenating it