adding post image logic