i had troubles adding images when writing new post, so i looked here:
/wp-admin/includes/media.php
line 43:
if ( intval($_REQUEST['post_id']) )
if ($_REQUEST['post_id']<0){$_REQUEST['post_id']=0;} //fix
//if you comment out previous line, post id will be negative
echo "<p style='font-size:25px;text-align:right;'>post-id:".$_REQUEST['post_id']."</p>";
seems working now