     
     init(node: Node) throws {
         url = try node.extract("url")
-        type = try? node.extract("type")
+        type = try node.extract("type")
         
         if let context: ParentContext = node.context as? ParentContext {
             product_id = context.parent_id

    static var permitted: [String] = ["product_id", "url", "type"]
    
    let url: String
    let type: Int?
    let product_id: Identifier
    
    static func pictures(for owner: Identifier) throws -> Query<ProductPicture> {

    func makeNode(in context: Context?) throws -> Node {
        return try Node(node: [
            "url" : .string(url),
            "type" : .number(.int(type))
        ]).add(objects: [
            "id" : id,
            "product_id" : product_id
        ])
    }
    
