Fixing js error when trying to throw error in similar images view.