imgdir and imgurl should be seperate variables