Lay the pallet directly on your work surface, face down. Use the pencil to mark the cut marks. You'll cut directly to the left or right of the center support piece. The photo shows where you'll be cutting with the saw.
Take the saw and cut along the lines. Count two rows of pallet boards down and cut across the left and center vertical boards.
On the right side of the center board, cut all the way down, both top boards and bottom boards.
You will have extra boards left over. Choose two of the extra boards and secure them as the shelf bottoms with the nail gun. Add nails around your shelf for additional support.
Use a stud finder to drill the shelf directly in the wall.