ENH: Average images inside R