convert image while copying it to its destination