Fixes bug so images can now be removed without problems