Add imagedata function.