adding image code for post creation