Fixed PIL installation occurring before symlinks and bug in writing image to output