Raspberry Pi Camera and HASS All-In-One Installer

I am having an issue getting my Raspberry Pi camera to work with HA, It does not create the image file. The file was created with the touch command, both the folder and files owner were changed to hass and full access given to user and group hass.
Folder
drwxrwxrwx 2 hass hass 4096 Dec 9 11:01 picamera
File
-rwxrwxrwx 1 hass hass 4181972 Dec 9 10:26 image.jpg
The image.jpg file is never written to, file size remains 0. If I switch to the hass user
Sudo su -s /bin/bash hass
And create the file using the rasstill command the image is created and will display on the HA webpage
raspistill -o image.jpg

I installed HA using the Raspberry Pi All-In-One Installer, could that be my issue ? Does it use a different user other then hass to write the image file ?
Running version of HA is 0.34.4 and my configuration.yaml file is as follows

camera:
  - platform: rpi_camera
    name: Raspberry Pi Camera V2
    timelapse: 1000
    file_path: /home/hass/picamera/image.jpg

Errors are reported in the log file

16-12-10 08:50:43 homeassistant.components.recorder: (sqlite3.DatabaseError) database disk image is malformed [SQL: 'SELECT states.state_id AS states_state_id, states.domain AS states_doma
in, states.entity_id AS states_entity_id, states.state AS states_state, states.attributes AS states_attributes, states.event_id AS states_event_id, states.last_changed AS states_last_chang
ed, states.last_updated AS states_last_updated, states.created AS states_created \nFROM states JOIN (SELECT max(states.state_id) AS max_state_id \nFROM states \nWHERE states.created >= ? A
ND states.created < ? AND states.domain NOT IN (?, ?) AND states.entity_id IN (?) GROUP BY states.entity_id) AS anon_1 ON states.state_id = anon_1.max_state_id'] [parameters: ('2016-12-08
21:02:03.881826', '2016-12-09 13:50:41.064188', 'zone', 'scene', 'camera.raspberry_pi_camera_v2')]
Traceback (most recent call last):
  File "/home/hass/.homeassistant/deps/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/home/hass/.homeassistant/deps/sqlalchemy/engine/default.py", line 469, in do_execute
    cursor.execute(statement, parameters)
sqlite3.DatabaseError: database disk image is malformed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/recorder/__init__.py", line 70, in execute
    (row.to_native() for row in q)
  File "/home/hass/.homeassistant/deps/sqlalchemy/orm/query.py", line 2797, in __iter__
    return self._execute_and_instances(context)
  File "/home/hass/.homeassistant/deps/sqlalchemy/orm/query.py", line 2820, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/home/hass/.homeassistant/deps/sqlalchemy/engine/base.py", line 945, in execute
    return meth(self, multiparams, params)
  File "/home/hass/.homeassistant/deps/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/home/hass/.homeassistant/deps/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/home/hass/.homeassistant/deps/sqlalchemy/engine/base.py", line 1189, in _execute_context
    context)
  File "/home/hass/.homeassistant/deps/sqlalchemy/engine/base.py", line 1393, in _handle_dbapi_exception
    exc_info
  File "/home/hass/.homeassistant/deps/sqlalchemy/util/compat.py", line 202, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/home/hass/.homeassistant/deps/sqlalchemy/util/compat.py", line 185, in reraise
    raise value.with_traceback(tb)
  File "/home/hass/.homeassistant/deps/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/home/hass/.homeassistant/deps/sqlalchemy/engine/default.py", line 469, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.DatabaseError: (sqlite3.DatabaseError) database disk image is malformed [SQL: 'SELECT states.state_id AS states_state_id, states.domain AS states_domain, states.entity_id AS
 states_entity_id, states.state AS states_state, states.attributes AS states_attributes, states.event_id AS states_event_id, states.last_changed AS states_last_changed, states.last_updated
 AS states_last_updated, states.created AS states_created \nFROM states JOIN (SELECT max(states.state_id) AS max_state_id \nFROM states \nWHERE states.created >= ? AND states.created < ? A
ND states.domain NOT IN (?, ?) AND states.entity_id IN (?) GROUP BY states.entity_id) AS anon_1 ON states.state_id = anon_1.max_state_id'] [parameters: ('2016-12-08 21:02:03.881826', '2016
-12-09 13:50:41.064188', 'zone', 'scene', 'camera.raspberry_pi_camera_v2')]

This issue has been resolved by adding the following to my configuration.yaml file
image_height: 480
image_quality: 7
image_rotation: 0
horizontal_flip: 0
vertical_flip: 0

The camera can consume lots of resources. Make sure you watch how much CPU and RAM are being used while HA is running and images are being recorded.