Issue #1: JCrop preview image switched when an existing foreground image is selected. Cleaned up some invalid JCrop script references. Cleaned up commented out old code. Resolved scoping issues. Moved all functions into same scope level.