Inserts an image into the buffer.
If filename is null, then the user is queried for a filename. If type is not a valid image type (one of the ones that can be passed to load-file), then the file type is deduced from the file's extension and verified by the user.