todo: 1. check for libjpeg properly in configure.ac (at the moment it is part of TIFF check) 2. move all image writing stuff to the image_writer_factory