Move .naturalWidth check into function, hide the logic