Added memory management for procedure images