remove wait, put quotas around ${LOGFILE} and correct call to pngcrush