Removed useless variables, restructured width calculation for #gallery-wrap