bug fixed that caused crash when pixels were painted on the very edge of the image