Thanks a lot Josh. Your plugin didn’t have anything wrong. It was all my fault, sorry. In the same days I updated WP to v.3.5 I tried to clean the wp_posts table. It gets cluttered from all the revisions, as it inserts a record each time you change something in any post. It’s useful when you are creating new content, as you can recover previous material, but it gets your DB much bigger.
I deleted the records with post_status = “revision”, which seems that is the right thing to do. But later I went further and deleted the post_status = “inherit”, and that’s where it seems that were the info of the attached images. A restore of a backup got it ok again. I did an upgrade.php of the bd, as the restore was from a previous WP version, so it all seems fine again.
Regards. tvc