Adding Background images

Hi,

Is there a way to add background images with Python? I’ve tried

bpy.ops.view3d.background_image_add(

but it has to be in 3D view. Is there a way to get around this?

Thanks
Tom