Add some scope functions to the image card directive and found a surprising bug requiring the use of angular.toJson instead of JSON.stringify for storage