added if statement to plot function to prevent crashing
edge detectionn criteria no longer makes cutout fail, instead proc flag is set to 32
very useful function for scaling images written by Min-Su Shin at U. of Michigan, found in 2010 astrobetter post by J. Lu