corrected parameters in unshift_post_json_db() function
handle posts without images