minor cleanup and more comments
inode type cleanup
improve image reader/writer logic