The commission usually comes off the total sale price. So, if you sell a framed photo for $500, the gallery takes $250. Since you paid for the framing, matting, and the cost of the print itself (cost of your paper, chemicals, or ink if its digital), your profits are far less than the gallery's. The gallery will say, well we have overhead to pay too...but so does the artist.