work on imlib2, and other minor tweaks