javascript tile preview