handling different params of drawImage