Replaced all storage-related uses of bits/8 and (bits+7)/8 with Type::bytes()

Internally does (bits+7)/8. This should prevent some further bool-related bugs.
Marked header-functions in image_io.h as inline to prevent duplicate symbols.