Checks for empty field before outputting img tag