fix bug in attachment class that caused imagefilter create_tmp_copy to fail