ImageAdmin with preview: re-organized and code cleanup