Moved image similarity check out of models module.