added a useful macro and a function to synchronously load PImages