Move src assignament to the end of the paint method