image uploading base functional for posts