have encode take url param instead of image directly