Image encoding/decoding implementation for Linux.

Currently unable to test as internal libz conflicts with system libpng, so possibly need to bring
this in.