Important update:

Now the types indices are shifted down by 1!!!
0,'non-graph'
1,'line'
2,'scatter'
3,'bar'
4,'line-scatter'
Also now, the database retrieves random rows.
KERNEL_NUMBER is now 5. Feel free to change it.
The weight varies now exponentially. Just to maximize the chances that a
maximum match gets through.

Also, from previous commit: cmp_results are multiplied with the
relevance value from the database (which is stored in a local variable
called imageRatings).

Image processing doesn't always work. It sometimes throws an exception.