Refactor the boilerplate code

- Remove type-dependent information from Image class
- And dump it in ImageType class
- TODO: Byte order reversal on 16-bit input