Modify performOperation() to take a BufferedImage instead of a CustomCanvas (preparing for server-side image)