Made pixel intensity conversion work with more formats