added some mechanics to write light image
doing now normalization when getting image, instead of after adding every sample