A study has shown that only a fraction of the major studio films last year featured gay characters, most of whom were painted in a bad light.