ENH: Add image average function.