The following formula works:

=IF(AND($B5=$B4,$B4=$B3,$N5>=1),HYPERLINK($U$2&$G$1&"\"&$D$2&"\"&$B4&"("&SUM(O$4,$N4,$N3)&")"&".JPG","("&SUM(O$4,$N4,$N3)&")"),IF(AND($B5=$B4,$N5>=1),HYPERLINK($U$2&$G$1&"\"&$D$2&"\"&$B4&"("&SUM(O$4,$N4)&")"&".JPG","("&SUM(O$4,$N4)&")"),IF($N5>=1,HYPERLINK($U$2&$G$1&"\"&$D$2&"\"&$B5&"(1).JPG","(1)"),"")))

All this formula says is that If I have a 1, 2, 3... 12 in this cell, then create a hyperlink ending in "(?)", where ? is a number depending on what I put in (either a 1, 2, 3... 12).

What I did now is rather than manually inputting in this 1, 2, 3... 12, I have it reference Sheet1!J2.
Sheet1!J2 will give me a number between 1-20 or a blank, depending on what the formula gives me.
The formula on Sheet1!J2 is =IF(K2="","",(MATCH(TRUE,INDEX(K2:X2="",0),0)-1)/2 )

So I will get my number, and it will create the right hyperlink.... but when the cell is blank, it still creates a hyperlink, although the cell is blank.

Why?
Where does my current long formula need to say: If cell is blank, don't create the hyperlink? It didn't do it before, but before i also manually input a number.