Adding temporary tables and new functions for generating images