file previewer and ajax validator