Passing state through the directive to get the image card popup functional