fixed bug in getFlag
extend loadRGB to automatically read BMP and PPM