fixing checksum by reading binary
fixing gallery detection by making it case insensitive