moved drawImg out of timeout so it has to wait