silence constructor and undefined variable notice, fixing store_image

function store_image was not receiving the name, so the metadata index was empty.