working file i/o for images.cpp