Show uploaded image in page

Show uploaded image in page

On my report I have a link to a page in a popup which displays an image that was added to each record.
The page opens in the popup correctly but the image doesn't display; the HTTP request for the image returns "500 (Internal Server Error)".

I also tried using a formula to show the image, like I saw mentioned somewhere, but I get similar results.

Here is the page that I have:
  1. htmlpage View_Image(recordId, imageNumber)
  2. displayname = "View Image"
  3. content
  4. <%{
  5.     record  =  My_Stuff  [ID == input.recordId.toLong()];
  6.     if (input.imageNumber  ==  "1")
  7.     {%><%=record.Image_1%>    <%}
  8.     if (input.imageNumber  ==  "2")
  9.     {%><%=record.Image_2%>    <%}
  10.     if (input.imageNumber  ==  "3")
  11.     {%><%=record.Image_3%>    <%}
  12. }%>
The images can be displayed in the report, but I wanted them to show in a popup instead.

Is there a way to do this?