Added some better error handling for image processing
Added 'domain' field to DB schema