Fixed memory leak
Added png support