Fix sql for image name