fixes bugs with no 24bits images