Yes, your image will turn white after a few frames because adding images pixel by pixel increases the brightness by quite a lot. You'll have to come up with a better algorithm to merge the images together.
One way you can do that is add the two images then normalize the resulting image before adding more images on, or if you're adding lots of frames, add only a small multiple (0.01) of the pixel value of the image to the resulting image each frame, but again, normalize the resulting image so dark pixels stay dark. This effectively simulates the long exposure effect that is created using real cameras.
Real cameras create that effect by having a very low exposure setting so only a few photons enter the lens at once, so when you leave the camera stationary for a while, more and more photos hit the film and eventually brightens up the picture. If you left the camera long enough. If you left the camera out for too long, the same thing will happen to the picture, it will go white. Adding pictures together directly is like having a very high exposure, lots of light enters the lens at once and the picture turns white.