attempt to write image to debug texture problem; not very successful