making imagelib into an object to simplify reading and writing images - no more creating (static) headers.