diff --git a/templates/webapi/step/viewimg.html.ep b/templates/webapi/step/viewimg.html.ep
index 41db70e4f2c..a10b7a6e0cd 100644
--- a/templates/webapi/step/viewimg.html.ep
+++ b/templates/webapi/step/viewimg.html.ep
@@ -1,4 +1,4 @@
-% use Mojo::JSON 'encode_json';
+% use Mojo::JSON 'to_json';
Candidate needles and tags:
@@ -37,8 +37,8 @@
% for my $needle (@{$needles_by_tag->{$tag}}) {
{selected}) {
% $has_selection = 1;