Rewrite search and delete image SQL query.